From 23c645388ce491059e6a6bd77b4359cd0618961e Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sun, 25 Jun 2023 19:38:35 -0400 Subject: [PATCH] fix model lookup directory for other routes --- proto.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/proto.py b/proto.py index 1c12db52..54be0f52 100644 --- a/proto.py +++ b/proto.py @@ -18,11 +18,11 @@ def load(): if not model: return Response("Model is required", status=400) - if not os.path.exists(f"../models/{model}.bin"): + if not os.path.exists(f"./models/{model}.bin"): return {"error": "The model does not exist."}, 400 if model not in llms: - llms[model] = Llama(model_path=f"../models/{model}.bin") + llms[model] = Llama(model_path=f"./models/{model}.bin") return Response(status=204) @@ -34,7 +34,7 @@ def unload(): if not model: return Response("Model is required", status=400) - if not os.path.exists(f"../models/{model}.bin"): + if not os.path.exists(f"./models/{model}.bin"): return {"error": "The model does not exist."}, 400 llms.pop(model, None) @@ -57,7 +57,7 @@ def generate(): if model not in llms: # auto load - llms[model] = Llama(model_path=f"../models/{model}.bin") + llms[model] = Llama(model_path=f"./models/{model}.bin") def stream_response(): stream = llms[model](