Балаганский Никита Николаевич commited on
Commit
ab4c068
1 Parent(s): ea5bdc0

stable caif

Browse files
Files changed (1) hide show
  1. sampling.py +1 -1
sampling.py CHANGED
@@ -121,7 +121,7 @@ class CAIFSampler:
121
  ).view(-1, top_k_classifier)
122
 
123
  next_token_probs = torch.exp(
124
- (top_next_token_log_probs[0] + classifier_weight * classifier_log_probs)
125
  / temperature
126
  )
127
  return next_token_probs, top_next_token_log_probs[1]
 
121
  ).view(-1, top_k_classifier)
122
 
123
  next_token_probs = torch.exp(
124
+ (top_next_token_log_probs[0] + classifier_weight * classifier_log_probs - top_next_token_log_probs[0].mean())
125
  / temperature
126
  )
127
  return next_token_probs, top_next_token_log_probs[1]