Spaces:
Sleeping
Sleeping
university helping chat bot
Browse filesmade the chatbot friendly and updated max tokens to 500
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 help pick options for university subjects"}]
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
@@ -15,7 +15,7 @@ def respond(message, history):
|
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
messages,
|
| 18 |
-
max_tokens=
|
| 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 chatbot to help pick options for university subjects"}]
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
|
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
messages,
|
| 18 |
+
max_tokens=500
|
| 19 |
)
|
| 20 |
return response['choices'][0]['message']['content'].strip()
|
| 21 |
|