Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,13 +9,10 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 9 |
client = InferenceClient("kronos25/Temporal_Chatbot")
|
| 10 |
|
| 11 |
def predict(message, history):
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
outputs = model.generate(**inputs,max_length=100)
|
| 17 |
-
model_result = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 18 |
-
return model_result + '\n'
|
| 19 |
|
| 20 |
gr.ChatInterface(
|
| 21 |
predict,
|
|
|
|
| 9 |
client = InferenceClient("kronos25/Temporal_Chatbot")
|
| 10 |
|
| 11 |
def predict(message, history):
|
| 12 |
+
for message in client.chat_completion(messages,max_tokens=max_tokens):
|
| 13 |
+
token = message.choices[0].delta.content
|
| 14 |
+
response += token
|
| 15 |
+
yield response
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
gr.ChatInterface(
|
| 18 |
predict,
|