Diamanta commited on
Commit
ddfcea6
·
verified ·
1 Parent(s): 5b048d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -20,14 +20,11 @@ class ChatRequest(BaseModel):
20
 
21
  @app.on_event("startup")
22
  def load_model():
23
- global llm
24
- model_path = "phi-2.Q4_K_M.gguf"
 
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")