Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,9 @@ def enhance_response(resp, message):
|
|
| 25 |
return " ".join(resp.split()[:15])
|
| 26 |
|
| 27 |
def chat(user_input, history):
|
|
|
|
|
|
|
|
|
|
| 28 |
context = format_context(history) + f"You: {user_input}\nπ΄ ππ πππ:"
|
| 29 |
inputs = tokenizer.encode(context, return_tensors="pt", truncation=True, max_length=1024)
|
| 30 |
|
|
|
|
| 25 |
return " ".join(resp.split()[:15])
|
| 26 |
|
| 27 |
def chat(user_input, history):
|
| 28 |
+
if history is None:
|
| 29 |
+
history = []
|
| 30 |
+
|
| 31 |
context = format_context(history) + f"You: {user_input}\nπ΄ ππ πππ:"
|
| 32 |
inputs = tokenizer.encode(context, return_tensors="pt", truncation=True, max_length=1024)
|
| 33 |
|