Schrieffer2sy commited on
Commit
5022f25
·
2 Parent(s): fabef551420b0f

Merge branch 'main' of https://huggingface.co/spaces/Schrieffer/SARM-Demo

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -37,7 +37,7 @@ def get_reward_score(prompt: str, response: str) -> float:
37
  # Use the same chat template as used during model training.
38
  messages = [{"role": "user", "content": prompt}, {"role": "assistant", "content": response}]
39
  # The model will handle moving inputs to the correct device automatically.
40
- input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt") # <<< REMOVED .to(DEVICE)
41
 
42
  with torch.no_grad():
43
  score = model(input_ids).logits.item()
 
37
  # Use the same chat template as used during model training.
38
  messages = [{"role": "user", "content": prompt}, {"role": "assistant", "content": response}]
39
  # The model will handle moving inputs to the correct device automatically.
40
+ input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(DEVICE) # <<< REMOVED .to(DEVICE)
41
 
42
  with torch.no_grad():
43
  score = model(input_ids).logits.item()