Skip to content

Commit 980ff55

Browse files
add
1 parent 2b8d6d3 commit 980ff55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,19 @@ output = model.generate(text)
310310
sf.write("simple.mp3", output, 44100)`,
311311
];
312312

313+
export const dia2 = (model: ModelData): string[] => [
314+
`from dia2 import Dia2, GenerationConfig, SamplingConfig
315+
316+
dia = Dia2.from_repo("${model.id}", device="cuda", dtype="bfloat16")
317+
config = GenerationConfig(
318+
cfg_scale=2.0,
319+
audio=SamplingConfig(temperature=0.8, top_k=50),
320+
use_cuda_graph=True,
321+
)
322+
result = dia.generate("[S1] Hello Dia2!", config=config, output_wav="hello.wav", verbose=True)
323+
`,
324+
];
325+
313326
export const describe_anything = (model: ModelData): string[] => [
314327
`# pip install git+https://github.com/NVlabs/describe-anything
315328
from huggingface_hub import snapshot_download

0 commit comments

Comments
 (0)