Update logit_processors/logit_.py
Browse files
logit_processors/logit_.py
CHANGED
|
@@ -44,7 +44,7 @@ class ThinkLogitsProcessor:
|
|
| 44 |
# If repetation detected, force </think>
|
| 45 |
if self.find_repeated_ngrams(past_token_ids, n=CHUNK_SIZE):
|
| 46 |
# Set all other logits to -inf except for </think>
|
| 47 |
-
logits = torch.full_like(logits, torch.finfo(
|
| 48 |
logits[self.think_end_token] = 1.0
|
| 49 |
else:
|
| 50 |
# ratio
|
|
|
|
| 44 |
# If repetation detected, force </think>
|
| 45 |
if self.find_repeated_ngrams(past_token_ids, n=CHUNK_SIZE):
|
| 46 |
# Set all other logits to -inf except for </think>
|
| 47 |
+
logits = torch.full_like(logits, torch.finfo(logits.dtype).min)
|
| 48 |
logits[self.think_end_token] = 1.0
|
| 49 |
else:
|
| 50 |
# ratio
|