Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,14 +36,15 @@ def chat_with_model(user_message, chat_history, max_new_tokens=60, temperature=0
|
|
| 36 |
|
| 37 |
# Generate
|
| 38 |
outputs = generator(
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
if "\n" in reply:
|
| 49 |
reply = reply.split("\n")[0].strip()
|
|
|
|
| 36 |
|
| 37 |
# Generate
|
| 38 |
outputs = generator(
|
| 39 |
+
history_text,
|
| 40 |
+
max_new_tokens=int(max_new_tokens),
|
| 41 |
+
do_sample=True,
|
| 42 |
+
temperature=float(temperature),
|
| 43 |
+
top_p=float(top_p)
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
raw = outputs[0]["generated_text"][len(history_text):]
|
| 47 |
+
reply = clean_reply(raw)
|
| 48 |
|
| 49 |
if "\n" in reply:
|
| 50 |
reply = reply.split("\n")[0].strip()
|