susanazhou commited on
Commit
39ea17a
verified
1 Parent(s): ee8e544

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
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
- # Obtener el token desde variable de entorno
11
- hf_token = os.environ.get("SSNZHY_TOKEN")
12
- if not hf_token:
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):