Machine-Learning-for-Medical-Language / cnlp_transformers

Transformers for Clinical NLP
https://cnlp-transformers.readthedocs.io/en/stable/
Apache License 2.0
21 stars 17 forks source link

Newer HF transformers version saves model weights as model.safetensors instead of pytorch_model.bin #198

Open guo0O0o opened 3 months ago

guo0O0o commented 3 months ago

Following sequence tagging Chemprot example gives errors on newer versions of HF transformers (currently on 4.41.2). Apparently model.save_pretrained('folder/') now saves model as .safetensors rather than .bin

tmills commented 2 months ago

image (4)

tmills commented 2 months ago

hmmm... I went to replicate this now and I can't get it to fail.

tmills commented 2 months ago

From @guo0O0o : i think you can also just add the flag --save_safetensors False at the end of your script