Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,10 +12,10 @@ def chatbot_model(m,history):
|
|
| 12 |
|
| 13 |
# Encode the prompt and generate response
|
| 14 |
input_ids = tokenizer.encode(prompt.format(m) + tokenizer.eos_token, return_tensors='pt')
|
| 15 |
-
|
| 16 |
|
| 17 |
# Decode the output
|
| 18 |
-
decoded_output = tokenizer.
|
| 19 |
return decoded_output
|
| 20 |
|
| 21 |
iface = gr.ChatInterface(chatbot_model)
|
|
|
|
| 12 |
|
| 13 |
# Encode the prompt and generate response
|
| 14 |
input_ids = tokenizer.encode(prompt.format(m) + tokenizer.eos_token, return_tensors='pt')
|
| 15 |
+
outputs = model.generate(input_ids, max_length=1000, pad_token_id=tokenizer.eos_token_id)
|
| 16 |
|
| 17 |
# Decode the output
|
| 18 |
+
decoded_output = tokenizer.batch_decode(outputs, skip_special_tokens=True)
|
| 19 |
return decoded_output
|
| 20 |
|
| 21 |
iface = gr.ChatInterface(chatbot_model)
|