Skip to content

Commit 7022cbd

Browse files
add dia2 snippet
1 parent e841a53 commit 7022cbd

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-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

packages/tasks/src/model-libraries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
273273
snippets: snippets.dia,
274274
filter: false,
275275
},
276+
"dia2-tts": {
277+
prettyLabel: "Dia2",
278+
repoName: "Dia2",
279+
repoUrl: "https://github.com/nari-labs/dia2",
280+
snippets: snippets.dia2,
281+
filter: false,
282+
},
276283
diffree: {
277284
prettyLabel: "Diffree",
278285
repoName: "Diffree",

0 commit comments

Comments
 (0)