Skip to content

Instantly share code, notes, and snippets.

View McHughes288's full-sized avatar

John Hughes McHughes288

View GitHub Profile
@McHughes288
McHughes288 / ILM_subtraction.py
Created October 13, 2022 22:06
Internal Language Model Subtraction
def fast_beam_search(
model: Transducer,
decoding_graph: k2.Fsa,
encoder_out: torch.Tensor,
encoder_out_lens: torch.Tensor,
beam: float,
max_states: int,
max_contexts: int,
temperature: float = 1.0,
ILM_lambda: float = 0.0,