Spaces:
Runtime error
Runtime error
armandstrickernlp
commited on
Commit
·
b4f246b
1
Parent(s):
1a8e94e
create chatbot
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def generate_response(prompt):
|
|
| 14 |
return tokenizer_TOD.batch_decode(outputs)[0]
|
| 15 |
|
| 16 |
#<|context|> <|user|> I want to go to the restaurant.<|endofcontext|>
|
| 17 |
-
|
| 18 |
|
| 19 |
def chat(message, history):
|
| 20 |
history = history or []
|
|
@@ -28,7 +28,7 @@ def chat(message, history):
|
|
| 28 |
context += ' <|user|> ' + message + ' <|endofcontext|> '
|
| 29 |
|
| 30 |
output = generate_response(context)
|
| 31 |
-
|
| 32 |
|
| 33 |
history.append((message, response))
|
| 34 |
|
|
|
|
| 14 |
return tokenizer_TOD.batch_decode(outputs)[0]
|
| 15 |
|
| 16 |
#<|context|> <|user|> I want to go to the restaurant.<|endofcontext|>
|
| 17 |
+
|
| 18 |
|
| 19 |
def chat(message, history):
|
| 20 |
history = history or []
|
|
|
|
| 28 |
context += ' <|user|> ' + message + ' <|endofcontext|> '
|
| 29 |
|
| 30 |
output = generate_response(context)
|
| 31 |
+
_ , response = output.split('<|endofcontext|>')
|
| 32 |
|
| 33 |
history.append((message, response))
|
| 34 |
|