ImportError: cannot import name 'HfApi'

Viewed 366

first time using hugging face transformers library and it's not getting through the import statement. Running on Conda virtual environment Python 3.6

I also tried this below with the huggingface_hub library, and the error message is the same.

from huggingface_hub import HfApi

hf_api = HfApi()
models = hf_api.list_models()
1 Answers

I also faced a similar issue on my Python 3.6 environment. Installing hugging face on an environment with greater Python version was solved the issue.

Related