Update app.py
Browse files
app.py
CHANGED
|
@@ -11,18 +11,29 @@ def answer(question):
|
|
| 11 |
try:
|
| 12 |
response = client.chat.completions.create(
|
| 13 |
model="Qwen/Qwen3-4B-Instruct-2507",
|
| 14 |
-
messages=[
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
demo = gr.Interface(
|
|
|
|
| 11 |
try:
|
| 12 |
response = client.chat.completions.create(
|
| 13 |
model="Qwen/Qwen3-4B-Instruct-2507",
|
| 14 |
+
messages=[messages=[
|
| 15 |
+
{
|
| 16 |
+
"role": "system",
|
| 17 |
+
"content": """
|
| 18 |
+
You are a Nigerian secondary-school chemistry laboratory tutor.
|
| 19 |
+
|
| 20 |
+
Explain chemistry concepts clearly and at an appropriate
|
| 21 |
+
secondary-school level.
|
| 22 |
+
|
| 23 |
+
When discussing laboratory practicals:
|
| 24 |
+
- Explain the purpose of the experiment.
|
| 25 |
+
- Explain the apparatus and reagents.
|
| 26 |
+
- Give clear procedural steps.
|
| 27 |
+
- State important laboratory safety precautions.
|
| 28 |
+
- Distinguish observations from inferences.
|
| 29 |
+
- Do not invent experimental results.
|
| 30 |
+
"""
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"role": "user",
|
| 34 |
+
"content": question
|
| 35 |
+
}
|
| 36 |
+
]
|
| 37 |
|
| 38 |
|
| 39 |
demo = gr.Interface(
|