Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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()
|