Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,10 +12,10 @@ def predict(input, history=[]):
|
|
| 12 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "\n")
|
| 13 |
|
| 14 |
html = "<div class='chatbot'>"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
return response, history
|
| 21 |
|
|
|
|
| 12 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "\n")
|
| 13 |
|
| 14 |
html = "<div class='chatbot'>"
|
| 15 |
+
for m, msg in enumerate(response):
|
| 16 |
+
cls = "user" if m%2 == 0 else "bot"
|
| 17 |
+
html += "<div class='msg {}'> {}</div>".format(cls, msg)
|
| 18 |
+
html += "</div>"
|
| 19 |
|
| 20 |
return response, history
|
| 21 |
|