local cache issue #49

by - opened

Hi, after cloning this space and downloading everything needed, it works well but only when my internet is available.
Something is not downloading but unsure what it may be.
I see the cached files are in my .cached dir, however, they are not being located if my interenet has been lost.

Traceback (most recent call last):
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
self.sock = conn = self._new_conn()
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fd8ec1b03a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/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/multimodalart/sd-fine-tunable/revision/main (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd8ec1b03a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/systemadministrator/dreambooth-training/app.py", line 48, in
model_v1 = snapshot_download(repo_id="multimodalart/sd-fine-tunable")
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/utils/_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/_snapshot_download.py", line 157, in snapshot_download
repo_info = _api.repo_info(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1425, in repo_info
return method(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
return fn(*args, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 1228, in model_info
r = requests.get(
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/home/systemadministrator/anaconda3/envs/dreamboothtraining/lib/python3.10/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/multimodalart/sd-fine-tunable/revision/main (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd8ec1b03a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

Thanks for flagging this. This seems to be an issue with the diffusers library. I agree that it should work if you are not online. Feel free to fill an issue here: https://github.com/huggingface/diffusers/

Hi, I was able to get it working offline after editing app.py to load local files.

#Pre download the files
#if(is_gpu_associated):

model_v1 = snapshot_download(repo_id="multimodalart/sd-fine-tunable")

model_v2 = snapshot_download(repo_id="stabilityai/stable-diffusion-2-1", ignore_patterns=[".ckpt", ".safetensors"])

model_v2_512 = snapshot_download(repo_id="stabilityai/stable-diffusion-2-1-base", ignore_patterns=[".ckpt", ".safetensors"])

safety_checker = snapshot_download(repo_id="multimodalart/sd-sc")

model_to_load = model_v1

#Pre download the files
if(is_gpu_associated):
model_v1 = snapshot_download(repo_id="multimodalart/sd-fine-tunable", local_files_only=True)
model_v2 = snapshot_download(repo_id="stabilityai/stable-diffusion-2-1", local_files_only=True, ignore_patterns=[".ckpt", ".safetensors"])
model_v2_512 = snapshot_download(repo_id="stabilityai/stable-diffusion-2-1-base", local_files_only=True, ignore_patterns=[".ckpt", ".safetensors"])
safety_checker = snapshot_download(repo_id="multimodalart/sd-sc", local_files_only=True)
model_to_load = model_v1

#Something additional. The tmp folder can become enormous in size with numerous diffusers compressed files.

changed discussion status to closed

Sign up or log in to comment