MCPcopy
hub / github.com/nari-labs/dia / new

Method new

dia/state.py:189–199  ·  view source on GitHub ↗
(cls, batch_size: int, config: DiaConfig, device: torch.device)

Source from the content-addressed store, hash-verified

187
188 @classmethod
189 def new(cls, batch_size: int, config: DiaConfig, device: torch.device) -> "DecoderOutput":
190 max_audio_len = config.decoder_config.max_position_embeddings
191 return cls(
192 generated_tokens=torch.full(
193 (batch_size, max_audio_len, config.decoder_config.num_channels),
194 fill_value=-1,
195 dtype=torch.int,
196 device=device,
197 ),
198 prefill_steps=[],
199 )
200
201 def get_tokens_at(self, step_from: int, step_to: int | None = None) -> torch.Tensor:
202 if step_to is None:

Callers 1

_prepare_generationMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected