mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
11 lines
439 B
Python
11 lines
439 B
Python
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
|