Update app.py
Browse files
app.py
CHANGED
|
@@ -7,14 +7,9 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 7 |
model_id = "somosnlp-hackathon-2025/leia_preference_model_social_norms"
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
raise ValueError("El token de Hugging Face no est谩 definido. Configura la variable de entorno 'SSNZHY_TOKEN'.")
|
| 14 |
-
|
| 15 |
-
# Cargar modelo y tokenizer con autenticaci贸n
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id, token=hf_token)
|
| 17 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, token=hf_token).to(device)
|
| 18 |
|
| 19 |
# Funci贸n de respuesta del chatbot
|
| 20 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
|
|
| 7 |
model_id = "somosnlp-hackathon-2025/leia_preference_model_social_norms"
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
|
| 10 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 11 |
+
model = AutoModelForCausalLM.from_pretrained(model_id).to(device)
|
| 12 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Funci贸n de respuesta del chatbot
|
| 15 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|