admin管理员组文章数量:1393052
I am having a very hard time with login to huggingface via pycharm on macos.
The below code snippet never works :-
from huggingface_hub import login
login("<HF_TOKEN>")
I get the error:
exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/whoami-v2
If I add the following code snipped before the login call:-
import warnings
warnings.filterwarnings('ignore')
def backend_factory() -> requests.Session:
session = requests.Session()
session.verify = False
return session
configure_http_backend(backend_factory=backend_factory)
os.environ['CURL_CA_BUNDLE'] = ''
os.environ['HF_ENDPOINT'] = ''
# os.environ['HF_HUB_OFFLINE'] = '0'
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
pass
else:
ssl._create_default_https_context = _create_unverified_https_context
login("<HF_TOKEN>")
Then I get the error:
fHubHTTPError('401 Client Error: Unauthorized for url:
requests.exceptions.HTTPError: Invalid user token. The token stored is invalid. Please run
huggingface-cli login
to update it.
And sometimes I get invalid token error. I have also observed that with notebook_login() it seems to work, but I want to work with pycharm and not able to make the login work.
I have tried creating all types of token at [Read/ Write/Fine grained]
It could be some issue with my macos - any help is highly appreciated in resolving this.
本文标签: huggingfaceHugging face login on macosStack Overflow
版权声明:本文标题:huggingface - Hugging face login on macos - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744657280a2618042.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论