Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,14 +20,11 @@ class ChatRequest(BaseModel):
|
|
20 |
|
21 |
@app.on_event("startup")
|
22 |
def load_model():
|
23 |
-
|
24 |
-
|
|
|
25 |
if not os.path.exists(model_path):
|
26 |
raise RuntimeError(f"Model not found: {model_path}")
|
27 |
-
llm = Llama(
|
28 |
-
model_path=model_path,
|
29 |
-
n_ctx=2048,
|
30 |
-
n_threads=2
|
31 |
)
|
32 |
|
33 |
@app.post("/v1/chat/completions")
|
|
|
20 |
|
21 |
@app.on_event("startup")
|
22 |
def load_model():
|
23 |
+
with open("/tmp/model_path.txt", "r") as f:
|
24 |
+
model_path = f.read().strip()
|
25 |
+
|
26 |
if not os.path.exists(model_path):
|
27 |
raise RuntimeError(f"Model not found: {model_path}")
|
|
|
|
|
|
|
|
|
28 |
)
|
29 |
|
30 |
@app.post("/v1/chat/completions")
|