Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def predict(
|
|
53 |
if 'choices' in json_response and len(json_response['choices']) > 0:
|
54 |
assistant_content = json_response['choices'][0]['message']['content']
|
55 |
chat_history.append({"role": "assistant", "content": assistant_content})
|
56 |
-
stats_content = f
|
57 |
else:
|
58 |
chat_history.append({"role": "assistant", "content": "Error: No response from assistant."})
|
59 |
|
|
|
53 |
if 'choices' in json_response and len(json_response['choices']) > 0:
|
54 |
assistant_content = json_response['choices'][0]['message']['content']
|
55 |
chat_history.append({"role": "assistant", "content": assistant_content})
|
56 |
+
stats_content = f'*Powered by Oxygen, Generation time: {json_response["usage"]["metrics"]["inference_time_ms"]} ms , Tokens per second: {json_response["usage"]["metrics"]["tokens_per_second"]} , Generation cost: {round(json_response["usage"]["cost"]["total"],10)} EUR*'
|
57 |
else:
|
58 |
chat_history.append({"role": "assistant", "content": "Error: No response from assistant."})
|
59 |
|