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

Feedback for “OfflineModeIsEnabled” #51

Open
IvyXue18 opened this issue Jan 25, 2025 · 1 comment
Open

Feedback for “OfflineModeIsEnabled” #51

IvyXue18 opened this issue Jan 25, 2025 · 1 comment

Comments

@IvyXue18
Copy link

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\file_download.py:1746 in _get_metadata_or_catch_error │
│ │
│ 1743 │ if not local_files_only: │
│ 1744 │ │ try: │
│ 1745 │ │ │ try: │
│ ❱ 1746 │ │ │ │ metadata = get_hf_file_metadata( │
│ 1747 │ │ │ │ │ url=url, proxies=proxies, timeout=etag_timeout, headers=headers, tok │
│ 1748 │ │ │ │ ) │
│ 1749 │ │ │ except EntryNotFoundError as http_error: │
│ │
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\utils_validators.py:114 in _inner_fn │
│ │
│ 111 │ │ if check_use_auth_token: │
│ 112 │ │ │ kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.name, has_token=ha │
│ 113 │ │ │
│ ❱ 114 │ │ return fn(*args, **kwargs) │
│ 115 │ │
│ 116 │ return _inner_fn # type: ignore │
│ 117 │
│ │
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\file_download.py:1666 in get_hf_file_metadata │
│ │
│ 1663 │ headers["Accept-Encoding"] = "identity" # prevent any compression => we want to kno │
│ 1664 │ │
│ 1665 │ # Retrieve metadata │
│ ❱ 1666 │ r = _request_wrapper( │
│ 1667 │ │ method="HEAD", │
│ 1668 │ │ url=url, │
│ 1669 │ │ headers=headers, │
│ │
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\file_download.py:364 in _request_wrapper │
│ │
│ 361 │ """ │
│ 362 │ # Recursively follow relative redirects │
│ 363 │ if follow_relative_redirects: │
│ ❱ 364 │ │ response = _request_wrapper( │
│ 365 │ │ │ method=method, │
│ 366 │ │ │ url=url, │
│ 367 │ │ │ follow_relative_redirects=False, │
│ │
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\file_download.py:387 in _request_wrapper │
│ │
│ 384 │ │ return response │
│ 385 │ │
│ 386 │ # Perform request and return if status_code is not in the retry list. │
│ ❱ 387 │ response = get_session().request(method=method, url=url, **params) │
│ 388 │ hf_raise_for_status(response) │
│ 389 │ return response │
│ 390 │
│ │
│ D:\softerware\Python\Lib\site-packages\requests\sessions.py:589 in request │
│ │
│ 586 │ │ │ "allow_redirects": allow_redirects, │
│ 587 │ │ } │
│ 588 │ │ send_kwargs.update(settings) │
│ ❱ 589 │ │ resp = self.send(prep, **send_kwargs) │
│ 590 │ │ │
│ 591 │ │ return resp │
│ 592 │
│ │
│ D:\softerware\Python\Lib\site-packages\requests\sessions.py:703 in send │
│ │
│ 700 │ │ start = preferred_clock() │
│ 701 │ │ │
│ 702 │ │ # Send the request │
│ ❱ 703 │ │ r = adapter.send(request, **kwargs) │
│ 704 │ │ │
│ 705 │ │ # Total elapsed time of the request (approximately) │
│ 706 │ │ elapsed = preferred_clock() - start │
│ │
│ D:\softerware\Python\Lib\site-packages\huggingface_hub\utils_http.py:104 in send │
│ │
│ 101 │
│ 102 class OfflineAdapter(HTTPAdapter): │
│ 103 │ def send(self, request: PreparedRequest, *args, **kwargs) -> Response: │
│ ❱ 104 │ │ raise OfflineModeIsEnabled( │
│ 105 │ │ │ f"Cannot reach {request.url}: offline mode is enabled. To disable it, please │
│ 106 │ │ ) │
│ 107 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
OfflineModeIsEnabled: Cannot reach https://huggingface.co/briaai/RMBG-1.4/resolve/main/model.pth: offline mode is
enabled. To disable it, please unset the HF_HUB_OFFLINE environment variable.

Image

问了claude,“
方法1:命令行输入:
Copyset HF_HUB_OFFLINE=
方法2:环境变量设置:
进入"系统属性"->"环境变量"
在"用户变量"下新建变量 HF_HUB_OFFLINE
不填写变量值,直接删除这个变量
完成后重启程序。”

这两种方式都试过了,没用

@Sanster
Copy link
Owner

Sanster commented Feb 21, 2025

请问你的启动命令是什么?这个错误可能和网络环境有关,命令行启动需要挂代理才能下载模型

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