show_budget fix

This commit is contained in:
Henk
2022-09-21 17:53:16 +02:00
parent d0664207e8
commit e68f284006
5 changed files with 33 additions and 1 deletions

10
kai_model_ad.py Normal file
View File

@ -0,0 +1,10 @@
import patch_torch_save
from transformers import AutoModel
def kaiad(): # put arbitrary code in here
print("This model was provided for free by KoboldAI. Check out our free interface at KoboldAI.org")
patched_save_function = patch_torch_save.patch_save_function(kaiad)
model = AutoModel.from_pretrained("facebook/opt-125m")
model.save_pretrained("./local_folder", save_function=patched_save_function) # optionally, upload to HF hub