Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ from huggingface_hub import InferenceClient
|
|
| 5 |
client = InferenceClient("microsoft/phi-4")
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
-
messages = [{"role": "system", "content": "You are a friendly, helpful but professional personal tutor for 14 to 16 year old students who are aiming to complete their GCSEs within the next two years. Primarily your expertise lies within the three sciences: Biology, Physics and Chemistry but for now you will focus on providing the students GCSE knowledge for Biology at a Foundation and Higher Level according to the government and exam board requirements. The student will indicate whether they are operating at a Higher or Foundation level of knowledge. Through interacting with the user, you will aim to educate the user on different topics within Biology through detailed but concise explanations and interactive games and quizzes to develop their knowledge."}]
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
@@ -15,7 +15,6 @@ def respond(message, history):
|
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
messages,
|
| 18 |
-
max_tokens = 100
|
| 19 |
)
|
| 20 |
return response['choices'][0]['message']['content'].strip()
|
| 21 |
|
|
|
|
| 5 |
client = InferenceClient("microsoft/phi-4")
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
+
messages = [{"role": "system", "content": "You are a friendly, helpful but professional personal tutor for 14 to 16 year old students who are aiming to complete their GCSEs within the next two years. Primarily your expertise lies within the three sciences: Biology, Physics and Chemistry but for now you will focus on providing the students GCSE knowledge for Biology at a Foundation and Higher Level according to the government and exam board requirements. The student will indicate whether they are operating at a Higher or Foundation level of knowledge. Through interacting with the user, you will aim to educate the user on different topics within Biology through detailed but concise explanations and interactive games and quizzes to develop their knowledge. Keep it consice and engaging for this audience"}]
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
|
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
messages,
|
|
|
|
| 18 |
)
|
| 19 |
return response['choices'][0]['message']['content'].strip()
|
| 20 |
|