diff --git a/timm/models/hub.py b/timm/models/hub.py index 265259e5..8b63ff7e 100644 --- a/timm/models/hub.py +++ b/timm/models/hub.py @@ -13,6 +13,7 @@ except ImportError: from torch.hub import _get_torch_home as get_dir from timm import __version__ + try: from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_download, hf_hub_url hf_hub_download = partial(hf_hub_download, library_name="timm", library_version=__version__) diff --git a/timm/models/vision_transformer.py b/timm/models/vision_transformer.py index b78b9197..ac8e820c 100644 --- a/timm/models/vision_transformer.py +++ b/timm/models/vision_transformer.py @@ -25,7 +25,6 @@ from functools import partial from collections import OrderedDict from typing import Optional -import huggingface_hub.file_download import torch import torch.nn as nn import torch.nn.functional as F