huggingface / setfit

Efficient few-shot learning with Sentence Transformers
https://hf.co/docs/setfit
Apache License 2.0
2.24k stars 223 forks source link

TemplateAssertionError: no test named 'False' #507

Open SaraTGRN opened 7 months ago

SaraTGRN commented 7 months ago

I am trying to save SetFit in my directory (which is databricks), but both commands of : trainer.model.save_pretrained(save directory) OR trainer.save_pretrained(save directory)

gives me the error of TemplateAssertionError: no test named 'False', can you help me how can I save my model.

OliverXiaoxiong commented 7 months ago

Sample problem, any solution?

szhong-ssmhealth commented 6 months ago

The following fixed the issue from my side when I use cpu for testing. !pip install jinja2 --upgrade import os os.environ["TOKENIZERS_PARALLELISM"] = "false"

dump(trainer.model, 'setfit_model.pkl') model=load('setfit_model.pkl')