Files
koe/example/simple_batch.py
Jaeyong SungandGitHub 36a4d5439c Batch implementation (#174)
* small enhancement

* implement batch inference

* fix cfg filter & eos detection

* fix lints
2025-05-04 00:15:51 +09:00

13 lines
484 B
Python

from dia.model import Dia
model = Dia.from_pretrained("nari-labs/Dia-1.6B", compute_dtype="float16")
text = "[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face."
texts = [text for _ in range(10)]
output = model.generate(texts, use_torch_compile=True, verbose=True, max_tokens=1500)
for i, o in enumerate(output):
model.save_audio(f"simple_{i}.mp3", o)