how to fix this error
from huggingface_hub import from_pretrained_keras
model = from_pretrained_keras(“soufyane/gemma_data_science”)
OSError Traceback (most recent call last)
Cell In[8], line 3
1 from huggingface_hub import from_pretrained_keras
----> 3 model = from_pretrained_keras(“soufyane/gemma_data_science”)
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/keras_mixin.py:296, in from_pretrained_keras(*args, **kwargs)
240 def from_pretrained_keras(*args, **kwargs) → “KerasModelHubMixin”:
241 r"“”
242 Instantiate a pretrained Keras model from a pre-trained model from the Hub.
243 The model is expected to be in SavedModel
format.
(…)
294
295 “”"
→ 296 return KerasModelHubMixin.from_pretrained(*args, **kwargs)
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py:119, in validate_hf_hub_args.._inner_fn(*args, **kwargs)
116 if check_use_auth_token:
117 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.name, has_token=has_token, kwargs=kwargs)
→ 119 return fn(*args, **kwargs)
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/hub_mixin.py:420, in ModelHubMixin.from_pretrained(cls, pretrained_model_name_or_path, force_download, resume_download, proxies, token, cache_dir, local_files_only, revision, **model_kwargs)
417 if cls._hub_mixin_inject_config:
418 model_kwargs[“config”] = config
→ 420 instance = cls._from_pretrained(
421 model_id=str(model_id),
422 revision=revision,
423 cache_dir=cache_dir,
424 force_download=force_download,
425 proxies=proxies,
426 resume_download=resume_download,
427 local_files_only=local_files_only,
428 token=token,
429 **model_kwargs,
430 )
432 # Implicitly set the config as instance attribute if not already set by the class
433 # This way config
will be available when calling save_pretrained
or push_to_hub
.
434 if config is not None and (getattr(instance, “_hub_mixin_config”, None) in (None, {})):
File /opt/conda/lib/python3.10/site-packages/huggingface_hub/keras_mixin.py:497, in KerasModelHubMixin._from_pretrained(cls, model_id, revision, cache_dir, force_download, proxies, resume_download, local_files_only, token, config, **model_kwargs)
494 storage_folder = model_id
496 # TODO: change this in a future PR. We are not returning a KerasModelHubMixin instance here…
→ 497 model = keras.models.load_model(storage_folder)
499 # For now, we add a new attribute, config, to store the config loaded from the hub/a local dir.
500 model.config = config
File /opt/conda/lib/python3.10/site-packages/tf_keras/src/saving/saving_api.py:262, in load_model(filepath, custom_objects, compile, safe_mode, **kwargs)
254 return saving_lib.load_model(
255 filepath,
256 custom_objects=custom_objects,
257 compile=compile,
258 safe_mode=safe_mode,
259 )
261 # Legacy case.
→ 262 return legacy_sm_saving_lib.load_model(
263 filepath, custom_objects=custom_objects, compile=compile, **kwargs
264 )
File /opt/conda/lib/python3.10/site-packages/tf_keras/src/utils/traceback_utils.py:70, in filter_traceback..error_handler(*args, **kwargs)
67 filtered_tb = _process_traceback_frames(e.traceback)
68 # To get the full stack trace, call:
69 # tf.debugging.disable_traceback_filtering()
—> 70 raise e.with_traceback(filtered_tb) from None
71 finally:
72 del filtered_tb
File /opt/conda/lib/python3.10/site-packages/tensorflow/python/saved_model/loader_impl.py:119, in parse_saved_model(export_dir)
117 raise IOError(f"Cannot parse file {path_to_pbtxt}: {str(e)}.“) from e
118 else:
→ 119 raise IOError(
120 f"SavedModel file does not exist at: {export_dir}{os.path.sep}”
121 f"{{{constants.SAVED_MODEL_FILENAME_PBTXT}|"
122 f"{constants.SAVED_MODEL_FILENAME_PB}}}")
123 return saved_model
OSError: SavedModel file does not exist at: /root/.cache/huggingface/hub/models–soufyane–gemma_data_science/snapshots/d9d2d8ce54328a7265c51f6a17d22df0880c2e4c/{saved_model.pbtxt|saved_model.pb}