Skip to content

Commit

Permalink
Enable keras download stats (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
merveenoyan committed May 4, 2022
1 parent 33c0de3 commit 7042df3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/huggingface_hub/file_download.py
Expand Up @@ -122,6 +122,10 @@ def is_tf_available():
return _tf_available


def get_tf_version():
return _tf_version


def is_fastai_available():
return _fastai_available

Expand Down
7 changes: 6 additions & 1 deletion src/huggingface_hub/keras_mixin.py
Expand Up @@ -8,6 +8,7 @@
import yaml
from huggingface_hub import ModelHubMixin
from huggingface_hub.file_download import (
get_tf_version,
is_graphviz_available,
is_pydot_available,
is_tf_available,
Expand Down Expand Up @@ -509,7 +510,11 @@ def _from_pretrained(
# Root is either a local filepath matching model_id or a cached snapshot
if not os.path.isdir(model_id):
storage_folder = snapshot_download(
repo_id=model_id, revision=revision, cache_dir=cache_dir
repo_id=model_id,
revision=revision,
cache_dir=cache_dir,
library_name="keras",
library_version=get_tf_version(),
)
else:
storage_folder = model_id
Expand Down

0 comments on commit 7042df3

Please sign in to comment.