Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,17 +35,25 @@ class GroqAgent:
|
|
| 35 |
"messages": [
|
| 36 |
{
|
| 37 |
"role": "system",
|
| 38 |
-
"content":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
},
|
| 40 |
{
|
| 41 |
"role": "user",
|
| 42 |
-
"content": question
|
| 43 |
}
|
| 44 |
],
|
| 45 |
-
"temperature": 0.
|
| 46 |
-
"max_tokens":
|
| 47 |
"top_p": 0.9
|
| 48 |
}
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
response = requests.post(
|
| 51 |
GROQ_API_URL,
|
|
|
|
| 35 |
"messages": [
|
| 36 |
{
|
| 37 |
"role": "system",
|
| 38 |
+
"content": (
|
| 39 |
+
"You are taking a strict multiple-choice exam. "
|
| 40 |
+
"For each question, give ONLY the final answer in 1-2 sentences. "
|
| 41 |
+
"No explanations, no introductions, no 'I'm an AI' statements. "
|
| 42 |
+
"If you can't see a video/image/file, use web knowledge and typical context to infer."
|
| 43 |
+
)
|
| 44 |
},
|
| 45 |
{
|
| 46 |
"role": "user",
|
| 47 |
+
"content": f"Question: {question}\n\nAnswer:"
|
| 48 |
}
|
| 49 |
],
|
| 50 |
+
"temperature": 0.1, # 更低的隨機性
|
| 51 |
+
"max_tokens": 300,
|
| 52 |
"top_p": 0.9
|
| 53 |
}
|
| 54 |
+
|
| 55 |
+
"top_p": 0.9
|
| 56 |
+
}
|
| 57 |
|
| 58 |
response = requests.post(
|
| 59 |
GROQ_API_URL,
|