Schrieffer commited on
Commit
1420b0f
·
verified ·
1 Parent(s): 3a01517

Update app.py

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