dvilasuero HF staff commited on
Commit
59420b1
1 Parent(s): cebe32f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -6
README.md CHANGED
@@ -38,10 +38,7 @@ def get_score(model, tokenizer, prompt, response):
38
  # Extract the logits
39
  logits = outputs.logits
40
 
41
- # Calculate the score as the maximum logit value
42
- score = torch.max(logits).item()
43
-
44
- return score
45
 
46
  # Example usage
47
  prompt = "What is Depreciation"
@@ -50,11 +47,11 @@ example_preferred_response = "Depreciation is the drop in value of an asset due
50
 
51
  score = get_score(model, tokenizer, prompt, example_less_pref_response)
52
  print(score)
53
- # >> -9.01173
54
 
55
  score = get_score(model, tokenizer, prompt, example_preferred_response)
56
  print(score)
57
- # >> 1.976404
58
  ```
59
 
60
  ## Scored examples
 
38
  # Extract the logits
39
  logits = outputs.logits
40
 
41
+ return logits.item()
 
 
 
42
 
43
  # Example usage
44
  prompt = "What is Depreciation"
 
47
 
48
  score = get_score(model, tokenizer, prompt, example_less_pref_response)
49
  print(score)
50
+ # >> -3.915163993835449
51
 
52
  score = get_score(model, tokenizer, prompt, example_preferred_response)
53
  print(score)
54
+ # >> 7.460323333740234
55
  ```
56
 
57
  ## Scored examples