add function

This commit is contained in:
Bruce MacDonald
2023-06-27 17:36:02 -04:00
parent 7454900733
commit 01d2667f8b
3 changed files with 18 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
import os
import json
import sys
import shutil
from contextlib import contextmanager
from llama_cpp import Llama as LLM
from template import template
@@ -61,3 +62,9 @@ def load(model, models_home=".", llms={}):
def unload(model, llms={}):
if model in llms:
llms.pop(model)
def add(file, models_home=".", *args, **kwargs):
if not os.path.exists(file):
raise ValueError("Model file {model} not found")
shutil.move(file, models_home)