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

Error while removing corrupted file #159

Open
NicSTT opened this issue Oct 1, 2024 · 1 comment
Open

Error while removing corrupted file #159

NicSTT opened this issue Oct 1, 2024 · 1 comment

Comments

@NicSTT
Copy link

NicSTT commented Oct 1, 2024

I keep getting the follow error, installing manually or via the one click install.

To get round it, could I put the downloaded file in the required folder?

If so, where would that be?

A new version of the following files was downloaded from https://huggingface.co/multimodalart/Florence-2-large-no-flash-attn:

  • modeling_florence2.py
    . Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
    pytorch_model.bin: 4%|██▍ | 62.9M/1.54G [02:29<58:39, 421kB/s]
    Traceback (most recent call last):

File "C:\fluxgym\env\lib\site-packages\huggingface_hub\file_download.py", line 523, in http_get
hf_transfer.download(
Exception: Error while removing corrupted file: The process cannot access the file because it is being used by another process. (os error 32)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\fluxgym\env\lib\site-packages\transformers\modeling_utils.py", line 3557, in from_pretrained
resolved_archive_file = cached_file(
File "C:\fluxgym\env\lib\site-packages\transformers\utils\hub.py", line 402, in cached_file
resolved_file = hf_hub_download(
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\utils_deprecation.py", line 101, in inner_f
return f(*args, **kwargs)
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\file_download.py", line 1240, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\file_download.py", line 1389, in _hf_hub_download_to_cache_dir
_download_to_tmp_and_move(
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\file_download.py", line 1915, in _download_to_tmp_and_move
http_get(
File "C:\fluxgym\env\lib\site-packages\huggingface_hub\file_download.py", line 534, in http_get
raise RuntimeError(
RuntimeError: An error occurred while downloading using hf_transfer. Consider disabling HF_HUB_ENABLE_HF_TRANSFER for better error handling.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\fluxgym\env\lib\site-packages\gradio\queueing.py", line 536, in process_events
response = await route_utils.call_process_api(
File "C:\fluxgym\env\lib\site-packages\gradio\route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "C:\fluxgym\env\lib\site-packages\gradio\blocks.py", line 1935, in process_api
result = await self.call_function(
File "C:\fluxgym\env\lib\site-packages\gradio\blocks.py", line 1532, in call_function
prediction = await utils.async_iteration(iterator)
File "C:\fluxgym\env\lib\site-packages\gradio\utils.py", line 671, in async_iteration
return await iterator.anext()
File "C:\fluxgym\env\lib\site-packages\gradio\utils.py", line 664, in anext
return await anyio.to_thread.run_sync(
File "C:\fluxgym\env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "C:\fluxgym\env\lib\site-packages\anyio_backends_asyncio.py", line 2405, in run_sync_in_worker_thread
return await future
File "C:\fluxgym\env\lib\site-packages\anyio_backends_asyncio.py", line 914, in run
result = context.run(func, *args)
File "C:\fluxgym\env\lib\site-packages\gradio\utils.py", line 647, in run_sync_iterator_async
return next(iterator)
File "C:\fluxgym\env\lib\site-packages\gradio\utils.py", line 809, in gen_wrapper
response = next(iterator)
File "C:\fluxgym\app.py", line 278, in run_captioning
model = AutoModelForCausalLM.from_pretrained(
File "C:\fluxgym\env\lib\site-packages\transformers\models\auto\auto_factory.py", line 559, in from_pretrained
return model_class.from_pretrained(
File "C:\fluxgym\env\lib\site-packages\transformers\modeling_utils.py", line 3644, in from_pretrained
raise EnvironmentError(
OSError: Can't load the model for 'multimodalart/Florence-2-large-no-flash-attn'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'multimodalart/Florence-2-large-no-flash-attn' is the correct path to a directory containing a file named pytorch_model.bin, tf_model.h5, model.ckpt or flax_model.msgpack.

@NicSTT
Copy link
Author

NicSTT commented Oct 3, 2024

I managed a work-around as no matter what I tried, reinstalling, different PC, it always got stuck then failed with the same message; never more than about 4 or 5% downloaded.

As with a lot of the files related to AI art, they reside in the .cache file under Users (Windows).

C:\Users\YOUR_NAME \.cache\huggingface\hub\models--multimodalart--Florence-2-large-no-flash-attn\snapshots\LONG_ALPHA_NUMERIC_FOLDER_NAME

EG: 8asd7dsf5asdf0a97asdf5as3df701asdfasf5asd7 (not mine)

In that folder, I copied a manually downloaded version, which worked after Gym downloaded a couple of missing/corrupted files, so worth a try if you have similar issues.

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

1 participant