Skip to content

Conversation

@zsxkib
Copy link

@zsxkib zsxkib commented Apr 24, 2025

Hey @nari-labs team! 👋

Dia is great! The way it generates dialogue with speaker tags and handles things like (laughs) is really well done.

To help people try Dia and use it in their projects, I've put it on Replicate:

Demo & API: https://replicate.com/zsxkib/dia

I also posted about it on X/Twitter here: https://x.com/zsakib_/status/1915037657064759716

What's new in this PR:

This PR adds the necessary files and configuration to run the existing Dia model on Replicate:

  • Added predict.py: A script to load the model and run it using Cog's interface.
  • Added cog.yaml: Defines the Python environment, system packages, and GPU requirements for Replicate.
  • Added .dockerignore: Optimizes the Docker build by excluding unnecessary files.
  • Updated .gitignore: Includes Replicate/Cog specific files like .cog/ and /model_cache/.
  • Updated README.md: Added a Replicate badge linking to the demo page.

This setup provides:

  1. A web interface for easy testing without any local setup.
  2. An API endpoint for developers to run Dia generation from their own code.

Example API Usage:

import replicate

output = replicate.run(
    "zsxkib/dia:VERSION_HASH", # Replace VERSION_HASH with the actual model version hash
    input={
        "text": "[S1] Hello there! How are you? [S2] I'm doing great, thanks for asking! (laughs)",
        "audio_prompt": "https://replicate.delivery/pbxt/YourAudioFile.mp3", # Optional
        "max_audio_prompt_seconds": 10, # Optional, controls prompt length (default 10s)
        "temperature": 1.3,
        "cfg_scale": 3.0
        # ... other parameters ...
    }
)
print(output)
# Output: URL to the generated .wav file

On Replicate, users pay for their own compute time, which helps keep things running even if a model gets popular.

Let me know if you have any questions or feedback on the Replicate page. Happy to change anything.

Thanks for making Dia open source!

- Sakib @ Replicate

@jaehong21 jaehong21 added documentation Improvements or additions to documentation enhancement New feature or refactor pending This need more time to evaluate labels Apr 24, 2025
Copy link
Collaborator

@buttercrab buttercrab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these changes under /example/replicate?

Moves cog.yaml, predict.py, and Replicate-specific README content
into the example/replicate/ directory as per reviewer feedback.

Updates the main README.md to link to the new example location.
@zsxkib
Copy link
Author

zsxkib commented May 16, 2025

Hi @buttercrab!

Thanks for the feedback! I've updated the PR based on your suggestion.

Specifically, I've:

  • Moved the Replicate-specific files (predict.py and cog.yaml) into a new example/replicate/ directory.
  • Created a new README.md within example/replicate/ which now includes the Replicate badge, API usage examples, and a brief explanation of the files.
  • Updated the main README.md to remove the badge and instead link to this new example directory and its README.

The Replicate badge is now only in the example/replicate/README.md. I wasn't sure if you'd prefer it to be completely removed or if having it within the example-specific README is okay. Please let me know if you'd like any further adjustments to the READMEs or anything else!

Thanks again for your guidance!

Best,
Sakib

README.md Outdated
<a href="https://huggingface.co/nari-labs/Dia-1.6B"><img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/model-on-hf-lg-dark.svg" alt="Dataset on HuggingFace" height=42 ></a>
<a href="https://huggingface.co/spaces/nari-labs/Dia-1.6B"><img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/open-in-hf-spaces-lg-dark.svg" alt="Space on HuggingFace" height=38></a>
</p>
<p align="center">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this

@zsxkib
Copy link
Author

zsxkib commented May 21, 2025

Hi @buttercrab,

I've removed the paragraph referencing the Replicate example from the main README.md as requested.

The commit for this is cb50d4d.

Please let me know if there's anything else!

Best,
Sakib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or refactor pending This need more time to evaluate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants