Requests.exceptions.ConnectionError:
For some well known reason we don't have direct access to huggingface.co, we usually use : export HF_ENDPOINT="https://hf-mirror.com" to get around this. But this method fails when we execute the following statement. python mii-sd.py
the error list is: Traceback (most recent call last): File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection raise err File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() ^^^^^^^^^^^^^^^^ File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f6c93e23e10>: Failed to establish a new connection: [Errno 101] Network i s unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/requests/adapters.py", line 487, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models?cursor=eyJfaWQiOnsiJGd0IjoiNjI xZmZkYzEzNjQ2OGQ3MDlmMTc4ZTA1In19 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6c93e23e10>: Failed to establish a new connect ion: [Errno 101] Network is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/lthpc/nvmessd/wj/DeepSpeed-MII/mii/legacy/examples/benchmark/txt2img/mii-sd.py", line 20, in
File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/pydantic/v1/fields.py", line 881, in validate
v, errors = self._validate_singleton(v, values, loc, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/pydantic/v1/fields.py", line 1098, in _validate_singleton
return self._apply_validators(v, values, loc, cls, self.validators)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/pydantic/v1/fields.py", line 1154, in apply_validators
v = validator(cls, v, values, self, self.model_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/lthpc/anaconda3/envs/wjtorch2.0.1/lib/python3.11/site-packages/pydantic/v1/class_validators.py", line 337, in
same error occurs on all examples on https://github.com/microsoft/DeepSpeed-MII/tree/main/mii/legacy/examples/local @mrwyattii Is there any way to avoid visiting huggingface.co or implement offline deployment? I actually already have the models I need in .cache.
@Weigaa please set "skip_model_check": True in your mii_config: https://github.com/microsoft/DeepSpeed-MII/blob/773b735d6294a98dd842d82ef024d0d9b050f66a/mii/legacy/config.py#L98
This should avoid connecting to the HF server to validate the model/task
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1GNc0HUee5YQH4Vtlk8ZbDjyJBYTEyabo (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc3f5ebb0a0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
How do you solve it?
This appears to be resolved so closing this issue for now. Please comment if not.