Open XavierXiao opened 1 year ago
Faced this issue myself. Your version of transformers
package is probably old and does not recognise subfolder
parameter.
Not related to this repo though.
+1 Following the guide https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion I also run into that error.
Im using transformers from pip... so.... its waiting till they release a new version?
already fixed at least in 4.22.1
You're right! The conda env has transformers version pinned to 4.19.2. Updated and solved :)
so what should we do if we face this error?
Say not today and upgrade transformers.
For me the case was that I had the environment already setup and transformers was pinned to 4.19 in the requirements.txt
So I just edited the requirements.txt and set transformers to at least 4.22.1 then run pip install -r requirements.txt, that did the trick for me
fwiw im getting this error with transformers 4.27.1
Also having issues on the latest version
Still happening as of 27 May with latest transformers version.
Also having the same issues on transformers==4.36.0 cuda==11.6 pytorch==1.12.0. Does anyone have a solution?
meet in 4.37.1
meet in 4.37.1
meet too! 4.37.1 do you solve this problem?
me too in 4.31.
same for 4.39.1
This can be internet issues, the below solved for me, run this in command line:
HF_ENDPOINT=https://hf-mirror.com python
# Or just add this before your xx.py and ignore the rest.
Then run the code to cache the model(change the model card name to what you need)
text_encoder = CLIPTextModel.from_pretrained( 'CompVis/stable-diffusion-v1-4', subfolder="text_encoder", use_auth_token=True )
Now run you code.
Env:
diffusers == 0.27.1
accelerate == 0.28.0
transformers == 4.35.2
I met this error when I use "stabilityai/stablelm-2-1_6b", because I build a folder with the path "stabilityai/stablelm-2-1_6b", which will guide transformers package to load model from the local folder. After removing the folder, the error disappears.
When using SD Diffusers, I got errors when running this line
text_encoder = CLIPTextModel.from_pretrained( 'CompVis/stable-diffusion-v1-4', subfolder="text_encoder", use_auth_token=True )
,where the error is
OSError: CompVis/stable-diffusion-v1-4 does not appear to have a file named config.json.
Any idea on why this happens?