Spaces:
Sleeping
Sleeping
Solarum Asteridion
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,8 @@ import pytz
|
|
| 4 |
import gradio as gr
|
| 5 |
import logging
|
| 6 |
import requests
|
|
|
|
|
|
|
| 7 |
grqapi = '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'
|
| 8 |
|
| 9 |
# Configure logging
|
|
@@ -80,8 +82,8 @@ def generate_response(user_message, conversation_history, model_name):
|
|
| 80 |
response = client.chat.completions.create(
|
| 81 |
model=model_name,
|
| 82 |
messages=messages,
|
| 83 |
-
temperature=1,
|
| 84 |
-
max_tokens=
|
| 85 |
)
|
| 86 |
ai_reply = response.choices[0].message.content.strip()
|
| 87 |
logger.info("------------------------------" + user_message + ", " + ai_reply)
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import logging
|
| 6 |
import requests
|
| 7 |
+
|
| 8 |
+
|
| 9 |
grqapi = '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'
|
| 10 |
|
| 11 |
# Configure logging
|
|
|
|
| 82 |
response = client.chat.completions.create(
|
| 83 |
model=model_name,
|
| 84 |
messages=messages,
|
| 85 |
+
temperature=1.25,
|
| 86 |
+
max_tokens=500, # Adjust as needed
|
| 87 |
)
|
| 88 |
ai_reply = response.choices[0].message.content.strip()
|
| 89 |
logger.info("------------------------------" + user_message + ", " + ai_reply)
|