Update app.py
Browse files
app.py
CHANGED
@@ -16,11 +16,10 @@ def respond(message, history):
|
|
16 |
#input_text = message if not history else history[-1]["content"] + " " + message
|
17 |
input_text = message
|
18 |
# 獲取模型的回應
|
19 |
-
response = pipe(input_text, max_length=
|
20 |
reply = response[0]['generated_text']
|
21 |
|
22 |
# 返回新的消息格式
|
23 |
-
#return [{"role": "user", "content": message}, {"role": "assistant", "content": reply}], history + [{"role": "user", "content": message}, {"role": "assistant", "content": reply}]
|
24 |
print(reply)
|
25 |
return reply
|
26 |
|
|
|
16 |
#input_text = message if not history else history[-1]["content"] + " " + message
|
17 |
input_text = message
|
18 |
# 獲取模型的回應
|
19 |
+
response = pipe(input_text, max_length=500, truncation=True, num_return_sequences=1)
|
20 |
reply = response[0]['generated_text']
|
21 |
|
22 |
# 返回新的消息格式
|
|
|
23 |
print(reply)
|
24 |
return reply
|
25 |
|