lievan commited on
Commit
463565d
1 Parent(s): 066d4a6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -6
README.md CHANGED
@@ -44,12 +44,12 @@ def test(model_path):
44
  model = AutoModel.from_pretrained(model_path, trust_remote_code=True)
45
 
46
  with torch.no_grad():
47
- for example in dataset:
48
- inputs = tokenizer(example["chosen"], return_tensors="pt")
49
- chosen_reward = model(**inputs).item()
50
- inputs = tokenizer(example["rejected"], return_tensors="pt")
51
- rejected_reward = model(**inputs).item()
52
- print(chosen_reward - rejected_reward)
53
 
54
  test("openbmb/Eurus-RM-7b")
55
  # Output: 47.4404296875
 
44
  model = AutoModel.from_pretrained(model_path, trust_remote_code=True)
45
 
46
  with torch.no_grad():
47
+ for example in dataset:
48
+ inputs = tokenizer(example["chosen"], return_tensors="pt")
49
+ chosen_reward = model(**inputs).item()
50
+ inputs = tokenizer(example["rejected"], return_tensors="pt")
51
+ rejected_reward = model(**inputs).item()
52
+ print(chosen_reward - rejected_reward)
53
 
54
  test("openbmb/Eurus-RM-7b")
55
  # Output: 47.4404296875