Spaces:
Build error
Build error
ficx input naming
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ import gradio as gr
|
|
| 21 |
|
| 22 |
|
| 23 |
def chat(message, history=[]):
|
| 24 |
-
new_user_input_ids = tokenizer.encode(
|
| 25 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
| 26 |
history = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id).tolist()
|
| 27 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "")
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
def chat(message, history=[]):
|
| 24 |
+
new_user_input_ids = tokenizer.encode(message+ tokenizer.eos_token, return_tensors='pt')
|
| 25 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
| 26 |
history = model.generate(bot_input_ids, max_length=500, pad_token_id=tokenizer.eos_token_id).tolist()
|
| 27 |
response = tokenizer.decode(history[0]).replace("<|endoftext|>", "")
|