Spaces:
Runtime error
Runtime error
fixed error
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
client = InferenceClient("microsoft/phi-4")
|
| 5 |
|
| 6 |
def respond(message,history): #function to return the history of messages sent
|
| 7 |
-
|
| 8 |
|
| 9 |
if history:
|
| 10 |
messages.extend(history)
|
|
@@ -14,7 +14,7 @@ def respond(message,history): #function to return the history of messages sent
|
|
| 14 |
|
| 15 |
responses = client.chat_completion(
|
| 16 |
messages,
|
| 17 |
-
|
| 18 |
)
|
| 19 |
return response['choices'][0]['message']['content'].strip()
|
| 20 |
|
|
|
|
| 4 |
client = InferenceClient("microsoft/phi-4")
|
| 5 |
|
| 6 |
def respond(message,history): #function to return the history of messages sent
|
| 7 |
+
message[{"role": "system", "content": "You are a friendly chatbot!"}]
|
| 8 |
|
| 9 |
if history:
|
| 10 |
messages.extend(history)
|
|
|
|
| 14 |
|
| 15 |
responses = client.chat_completion(
|
| 16 |
messages,
|
| 17 |
+
max_tokens = 568
|
| 18 |
)
|
| 19 |
return response['choices'][0]['message']['content'].strip()
|
| 20 |
|