Spaces:
Runtime error
Runtime error
kingabzpro
commited on
Commit
Β·
bea8217
1
Parent(s):
ee4d46e
Update app.py
Browse files
app.py
CHANGED
@@ -29,8 +29,8 @@ def predict(input, history=[]):
|
|
29 |
history = model.generate(bot_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id).tolist()
|
30 |
|
31 |
# convert the tokens to text, and then split the responses into the right format
|
32 |
-
response = tokenizer.decode(history[0]).
|
33 |
-
response = [(response[i], response[i+1]) for i in range(0, len(response)
|
34 |
return response, history
|
35 |
|
36 |
gr.Interface(
|
|
|
29 |
history = model.generate(bot_input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id).tolist()
|
30 |
|
31 |
# convert the tokens to text, and then split the responses into the right format
|
32 |
+
response = tokenizer.decode(history[0]).split("</s>")#.replace("<s>","")
|
33 |
+
response = [(response[i], response[i+1]) for i in range(0, len(response), 2)] # convert to tuples of list
|
34 |
return response, history
|
35 |
|
36 |
gr.Interface(
|