Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,7 @@ def chat_with_model(user_input, conversation_history=""):
|
|
38 |
|
39 |
conversation_history += f"Usuario: {user_input}\n"
|
40 |
|
41 |
-
input_tokens = tokenizer.encode(user_input, return_tensors='pt')
|
42 |
output_tokens = model_with_adapter.generate(input_tokens, max_new_tokens=50, pad_token_id=tokenizer.pad_token_id)
|
43 |
generated_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
|
44 |
|
|
|
38 |
|
39 |
conversation_history += f"Usuario: {user_input}\n"
|
40 |
|
41 |
+
input_tokens = tokenizer.encode(user_input, return_tensors='pt').to(device)
|
42 |
output_tokens = model_with_adapter.generate(input_tokens, max_new_tokens=50, pad_token_id=tokenizer.pad_token_id)
|
43 |
generated_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
|
44 |
|