Qwen
/

Text Generation
Transformers
Safetensors
Chinese
English
qwen
custom_code
JustinLin610 commited on
Commit
d222872
1 Parent(s): 4191e80

fix overflow

Browse files
Files changed (1) hide show
  1. qwen_generation_utils.py +1 -1
qwen_generation_utils.py CHANGED
@@ -346,7 +346,7 @@ class StopWordsLogitsProcessor(LogitsProcessor):
346
  stopped_samples = self._calc_stopped_samples(input_ids)
347
  for i, should_stop in enumerate(stopped_samples):
348
  if should_stop:
349
- scores[i, self.eos_token_id] = float(2**30)
350
  return scores
351
 
352
  def _tokens_match(self, prev_tokens: torch.LongTensor, tokens: List[int]) -> bool:
 
346
  stopped_samples = self._calc_stopped_samples(input_ids)
347
  for i, should_stop in enumerate(stopped_samples):
348
  if should_stop:
349
+ scores[i, self.eos_token_id] = float(2**15)
350
  return scores
351
 
352
  def _tokens_match(self, prev_tokens: torch.LongTensor, tokens: List[int]) -> bool: