Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,7 @@ hf_hub_download("TheBloke/deepseek-coder-1.3b-base-GGUF", "deepseek-coder-1.3b-b
|
|
12 |
|
13 |
model_l = Llama(model_path="./deepseek-coder-1.3b-base.Q5_K_M.gguf", n_ctx=16192, n_gpu_layers=0, n_threads=2, use_mlock=True)
|
14 |
|
15 |
-
|
16 |
-
@app.get("/check")
|
17 |
-
async def index():
|
18 |
-
return {"msg": "Hey!"}
|
19 |
|
20 |
@app.post("/api")
|
21 |
async def completion(request: Request):
|
@@ -30,8 +27,10 @@ async def completion(request: Request):
|
|
30 |
prompt,
|
31 |
temperature=0.6,
|
32 |
echo=False,
|
33 |
-
max_tokens=
|
34 |
)
|
|
|
|
|
35 |
return {"responses": res["choices"]}
|
36 |
except Exception as j:
|
37 |
print(j)
|
|
|
12 |
|
13 |
model_l = Llama(model_path="./deepseek-coder-1.3b-base.Q5_K_M.gguf", n_ctx=16192, n_gpu_layers=0, n_threads=2, use_mlock=True)
|
14 |
|
15 |
+
total = 0
|
|
|
|
|
|
|
16 |
|
17 |
@app.post("/api")
|
18 |
async def completion(request: Request):
|
|
|
27 |
prompt,
|
28 |
temperature=0.6,
|
29 |
echo=False,
|
30 |
+
max_tokens=32,
|
31 |
)
|
32 |
+
total+=1
|
33 |
+
print(total)
|
34 |
return {"responses": res["choices"]}
|
35 |
except Exception as j:
|
36 |
print(j)
|