MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS-Nano / _normalize_sample_mode

Function _normalize_sample_mode

ort_cpu_runtime.py:228–234  ·  view source on GitHub ↗
(raw_sample_mode: str | None, raw_do_sample: bool = True)

Source from the content-addressed store, hash-verified

226
227
228def _normalize_sample_mode(raw_sample_mode: str | None, raw_do_sample: bool = True) -> str:
229 normalized = str(raw_sample_mode or "").strip()
230 if normalized in {SAMPLE_MODE_GREEDY, SAMPLE_MODE_FIXED, SAMPLE_MODE_FULL}:
231 return normalized
232 if normalized == "mixed3":
233 return SAMPLE_MODE_FIXED if raw_do_sample else SAMPLE_MODE_GREEDY
234 return SAMPLE_MODE_GREEDY if not raw_do_sample else SAMPLE_MODE_FIXED
235
236
237def _compute_stream_lead_seconds(emitted_samples_total: int, sample_rate: int, first_audio_emitted_at_seconds: float | None) -> float:

Callers 2

synthesizeMethod · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected