Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/tasks/src/model-libraries-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,19 @@ output = model.generate(text)
sf.write("simple.mp3", output, 44100)`,
];

export const dia2 = (model: ModelData): string[] => [
`from dia2 import Dia2, GenerationConfig, SamplingConfig

dia = Dia2.from_repo("${model.id}", device="cuda", dtype="bfloat16")
config = GenerationConfig(
cfg_scale=2.0,
audio=SamplingConfig(temperature=0.8, top_k=50),
use_cuda_graph=True,
)
result = dia.generate("[S1] Hello Dia2!", config=config, output_wav="hello.wav", verbose=True)
`,
];

export const describe_anything = (model: ModelData): string[] => [
`# pip install git+https://github.com/NVlabs/describe-anything
from huggingface_hub import snapshot_download
Expand Down
7 changes: 7 additions & 0 deletions packages/tasks/src/model-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
snippets: snippets.dia,
filter: false,
},
"dia2": {
prettyLabel: "Dia2",
repoName: "Dia2",
repoUrl: "https://github.com/nari-labs/dia2",
snippets: snippets.dia2,
filter: false,
},
diffree: {
prettyLabel: "Diffree",
repoName: "Diffree",
Expand Down