Fixed parallelism issue
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def get_reply(response, username = None, histories = {}):
|
|
| 13 |
history = histories.get(username, [])
|
| 14 |
history.append(response)
|
| 15 |
if response.endswith(("bye", "Bye", "bye.", "Bye.")):
|
| 16 |
-
|
| 17 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
| 18 |
if len(history) > 4: history = history[-4:]
|
| 19 |
inputs = tokenizer(" ".join(history), return_tensors="pt")
|
|
|
|
| 13 |
history = histories.get(username, [])
|
| 14 |
history.append(response)
|
| 15 |
if response.endswith(("bye", "Bye", "bye.", "Bye.")):
|
| 16 |
+
histories[username] = []
|
| 17 |
return "<div class='chatbot'>Chatbot restarted</div>", histories
|
| 18 |
if len(history) > 4: history = history[-4:]
|
| 19 |
inputs = tokenizer(" ".join(history), return_tensors="pt")
|