File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ def is_tf_available():
122122 return _tf_available
123123
124124
125+ def get_tf_version ():
126+ return _tf_version
127+
128+
125129def is_fastai_available ():
126130 return _fastai_available
127131
Original file line number Diff line number Diff line change 88import yaml
99from huggingface_hub import ModelHubMixin
1010from huggingface_hub .file_download import (
11+ get_tf_version ,
1112 is_graphviz_available ,
1213 is_pydot_available ,
1314 is_tf_available ,
@@ -509,7 +510,11 @@ def _from_pretrained(
509510 # Root is either a local filepath matching model_id or a cached snapshot
510511 if not os .path .isdir (model_id ):
511512 storage_folder = snapshot_download (
512- repo_id = model_id , revision = revision , cache_dir = cache_dir
513+ repo_id = model_id ,
514+ revision = revision ,
515+ cache_dir = cache_dir ,
516+ library_name = "keras" ,
517+ library_version = get_tf_version (),
513518 )
514519 else :
515520 storage_folder = model_id
You can’t perform that action at this time.
0 commit comments