Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,7 +41,7 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta", provider="hf-inference"
|
|
| 41 |
def respond(message, history):
|
| 42 |
|
| 43 |
info = pull_relevant_info(message, top_k=3)
|
| 44 |
-
system_message = (f"You are a
|
| 45 |
messages = [{"role": "system", "content": system_message}]
|
| 46 |
|
| 47 |
if history:
|
|
@@ -53,7 +53,7 @@ def respond(message, history):
|
|
| 53 |
|
| 54 |
for message_chunk in client.chat_completion(
|
| 55 |
messages,
|
| 56 |
-
max_tokens=
|
| 57 |
stream=True
|
| 58 |
):
|
| 59 |
token = message_chunk['choices'][0]['delta'].get('content', '')
|
|
|
|
| 41 |
def respond(message, history):
|
| 42 |
|
| 43 |
info = pull_relevant_info(message, top_k=3)
|
| 44 |
+
system_message = (f"You are a helpful and kind teacher. You respond clearly in no more than three complete sentences. Use the following information to help answer the user's question:\n\n{info}\n\n")
|
| 45 |
messages = [{"role": "system", "content": system_message}]
|
| 46 |
|
| 47 |
if history:
|
|
|
|
| 53 |
|
| 54 |
for message_chunk in client.chat_completion(
|
| 55 |
messages,
|
| 56 |
+
max_tokens=1000,
|
| 57 |
stream=True
|
| 58 |
):
|
| 59 |
token = message_chunk['choices'][0]['delta'].get('content', '')
|