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 when runing OSError: Error no file named pytorch_model.bin? #16

Open
Pips01 opened this issue Feb 5, 2025 · 1 comment
Open

Comments

@Pips01
Copy link

Pips01 commented Feb 5, 2025

Hey,
i'm trying to run the gradio file with python gradio_server.py --profile 4
I'm using python 3.11, torch 2.5.1 and miniconda. I'm on win 11, with 32GB ram and a 3070 (yes, maybe not the best gpu for ai)
I hope someone can assist me.
Thanks
I'm getting this error:

You are attempting to use Flash Attention 2.0 with a model not initialized on GPU. Make sure to move the model to GPU after initializing it on CPU with model.to('cuda').
Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 3.99it/s]
F:\Miniconda\envs\yue\Lib\site-packages\torch\nn\utils\weight_norm.py:143: FutureWarning: torch.nn.utils.weight_norm is deprecated in favor of torch.nn.utils.parametrizations.weight_norm.
WeightNorm.apply(module, name, dim)
Traceback (most recent call last):
File "F:\YuEGP\inference\gradio_server.py", line 134, in
codec_model = eval(model_config.generator.name)(**model_config.generator.config).to(device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\YuEGP\inference\xcodec_mini_infer\models\soundstream_hubert_new.py", line 102, in init
self.semantic_model = AutoModel.from_pretrained("./xcodec_mini_infer/semantic_ckpts/hf_1_325000")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Miniconda\envs\yue\Lib\site-packages\transformers\models\auto\auto_factory.py", line 564, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Miniconda\envs\yue\Lib\site-packages\transformers\modeling_utils.py", line 3730, in from_pretrained
raise EnvironmentError(
OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory ./xcodec_mini_infer/semantic_ckpts/hf_1_325000.
Exception ignored in: <function MmapTracker.register..finalizer at 0x00000237813B14E0>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x000002376108B1A0>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023761055A80>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023761089800>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023761089C60>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023761055B20>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x00000237663C3240>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x00000237605020C0>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023760502020>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x00000237604F99E0>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023781408180>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023781408540>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
Exception ignored in: <function MmapTracker.register..finalizer at 0x0000023762624540>
Traceback (most recent call last):
File "F:\Miniconda\envs\yue\Lib\site-packages\mmgp\safetensors2.py", line 54, in finalizer
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

@Eydahn8
Copy link

Eydahn8 commented Feb 6, 2025

i'm having the same issue too

OSError: Error no file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory ./xcodec_mini_infer/semantic_ckpts/hf_1_325000.

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