Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'SAFETENSORS_SINGLE_FILE' from 'huggingface_hub.constants' #150

Open
Chandrak1907 opened this issue Jul 10, 2024 · 1 comment

Comments

@Chandrak1907
Copy link

after installing gliner, below line gives an error

from gliner import GLiNER


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/tmp/ipykernel_1653/103435563.py in <cell line: 1>()
----> 1 from gliner import GLiNER

~/conda/pytorch21_p39_gpu_v1/lib/python3.9/site-packages/gliner/__init__.py in <module>
      1 __version__ = "0.2.7"
      2 
----> 3 from .model import GLiNER
      4 from .config import GLiNERConfig
      5 

~/conda/pytorch21_p39_gpu_v1/lib/python3.9/site-packages/gliner/model.py in <module>
     21 from .config import GLiNERConfig
     22 
---> 23 from huggingface_hub import PyTorchModelHubMixin, snapshot_download
     24 
     25 class GLiNER(nn.Module, PyTorchModelHubMixin):

~/conda/pytorch21_p39_gpu_v1/lib/python3.9/site-packages/huggingface_hub/__init__.py in __getattr__(name)
    355         "TextToAudioParameters",
    356         "TextToImageInput",
--> 357         "TextToImageOutput",
    358         "TextToImageParameters",
    359         "TextToImageTargetSize",

~/conda/pytorch21_p39_gpu_v1/lib/python3.9/importlib/__init__.py in import_module(name, package)
    125                 break
    126             level += 1
--> 127     return _bootstrap._gcd_import(name[level:], package, level)
    128 
    129 

~/conda/pytorch21_p39_gpu_v1/lib/python3.9/site-packages/huggingface_hub/hub_mixin.py in <module>
     18 )
     19 
---> 20 from .constants import CONFIG_NAME, PYTORCH_WEIGHTS_NAME, SAFETENSORS_SINGLE_FILE
     21 from .file_download import hf_hub_download
     22 from .hf_api import HfApi

ImportError: cannot import name 'SAFETENSORS_SINGLE_FILE' from 'huggingface_hub.constants' (/home/datascience/conda/pytorch21_p39_gpu_v1/lib/python3.9/site-packages/huggingface_hub/constants.py)
@urchade
Copy link
Owner

urchade commented Jul 10, 2024

Hi, it looks like the problem come form your huggingface_hub version. try updating it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants