Update app.py
Browse files
app.py
CHANGED
@@ -52,17 +52,15 @@ def chat(selected_model, user_input, chat_history, system_prompt=""):
|
|
52 |
truncation=True
|
53 |
)
|
54 |
|
55 |
-
# Generate the response
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
top_k=60
|
65 |
-
)[0]['generated_text']
|
66 |
|
67 |
# Append the interaction to the chat history
|
68 |
chat_history.append((user_input, response))
|
|
|
52 |
truncation=True
|
53 |
)
|
54 |
|
55 |
+
# Generate the response
|
56 |
+
response = generator(
|
57 |
+
inputs['input_ids'],
|
58 |
+
max_length=max_length,
|
59 |
+
num_return_sequences=1,
|
60 |
+
do_sample=True,
|
61 |
+
top_p=0.95,
|
62 |
+
top_k=60
|
63 |
+
)[0]['generated_text']
|
|
|
|
|
64 |
|
65 |
# Append the interaction to the chat history
|
66 |
chat_history.append((user_input, response))
|