Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save a SetFit trainer locally after training

I am working on an HPC with no internet access on worker nodes and the only option to save a SetFit trainer after training, is to push it to HuggingFace hub. How do I go about saving it locally to disk?

https://github.com/huggingface/setfit

like image 400
Tanish Bafna Avatar asked Oct 22 '25 11:10

Tanish Bafna


1 Answers

setfit has this class method

model._save_pretrained(save_directory)

and to load it

saved_model = SetFitModel._from_pretrained(save_directory)
like image 151
user18610139 Avatar answered Oct 26 '25 20:10

user18610139