Update app.py
Browse files
app.py
CHANGED
|
@@ -424,8 +424,8 @@ async def handle_chat(chat_request: ChatRequest, token: str = Cookie(None)):
|
|
| 424 |
)
|
| 425 |
History[i].append({"role": "assistant", "content": chat_request.prompt})
|
| 426 |
return {"text": stream.choices[0].message.content,
|
| 427 |
-
"time": int(stream.timings
|
| 428 |
-
"t_per_sec": stream.timings.predicted_per_second+0.5}
|
| 429 |
else: return 'Please stop. Just refresh the page.'
|
| 430 |
|
| 431 |
@app.post("/history")
|
|
|
|
| 424 |
)
|
| 425 |
History[i].append({"role": "assistant", "content": chat_request.prompt})
|
| 426 |
return {"text": stream.choices[0].message.content,
|
| 427 |
+
"time": int(stream.timings["prompt_ms"] + stream.timings["predicted_ms"]) - 3,
|
| 428 |
+
"t_per_sec": stream.timings.["predicted_per_second"] +0.5}
|
| 429 |
else: return 'Please stop. Just refresh the page.'
|
| 430 |
|
| 431 |
@app.post("/history")
|