MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / InvalidScoreLogitsProcessor

Class InvalidScoreLogitsProcessor

diffsynth/models/kolors_text_encoder.py:311–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309
310
311class InvalidScoreLogitsProcessor(LogitsProcessor):
312 def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor:
313 if torch.isnan(scores).any() or torch.isinf(scores).any():
314 scores.zero_()
315 scores[..., 5] = 5e4
316 return scores
317
318
319class PrefixEncoder(torch.nn.Module):

Callers 2

chatMethod · 0.85
stream_chatMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected