Spaces:
Sleeping
Sleeping
Merge branch 'main' of https://huggingface.co/spaces/Schrieffer/SARM-Demo
Browse files
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()
|