HarryHe11/Any2Canto

1

stars

10

commits

Python

primary language

Apr 4, 2026

updated

README

Any2Canto πŸŽ™οΈ

Any2Canto turns text in any language into natural spoken Cantonese using OmniVoice zero-shot voice cloning. Optional LLM translation produces colloquial Cantonese before synthesis; Chinese input is normalized with OpenCC (Simplified β†’ Traditional, Hong Kong glyphs).

✨ Features

  • 🌐 Multilingual input β€” Type in English, Mandarin, Japanese, Korean, etc.; non-Chinese text can be translated to colloquial Cantonese via an LLM API (when configured).
  • 🎭 Voice cloning β€” Upload 3–10 seconds of reference speech.
  • 🧭 Cantonese-first pipeline β€” OpenCC s2hk + language detection to avoid unnecessary API calls for written Chinese.

πŸ“‚ Repository layout

PathPurpose
space/Gradio app (app.py), bundled omnivoice package, and Hugging Face Space metadata (space/README.md).
space/requirements.txtPython dependencies (PyTorch + Gradio stack).

πŸš€ Quick start (local)

From the space/ directory:

cd space
pip install -r requirements.txt

Set environment variables as needed:

VariableDescription
OMNIVOICE_MODELHugging Face model id or path (default: k2-fsa/OmniVoice).
OMNIVOICE_DEVICEOptional override: cuda, mps, or cpu. If unset, uses CUDA when available, else Apple MPS, else CPU.
LLM_API_KEYAPI key for translation; if unset, translation is skipped and you can still use Cantonese / Chinese input.
LLM_BASE_URLOpenAI-compatible chat completions URL (default points to a compatible endpoint; override for your provider).
LLM_MODELModel name for translation (default: qwen3.5-flash).

Run the UI:

python app.py

πŸ’‘ Local run: python app.py starts Gradio on localhost (default URL in the terminal). Device is picked automatically (cuda β†’ mps β†’ cpu); on Mac with Apple Silicon, install PyTorch for macOS (do not use the CUDA wheel index in requirements.txtβ€”install torch / torchaudio from pytorch.org or pip install torch torchaudio on Mac). On Hugging Face Spaces, spaces provides the GPU decorator; locally the app runs without that package.

πŸ€— Hugging Face Space

The file space/README.md contains the Space configuration front matter (app_file, sdk, etc.). Point your Space repository at space/ as the app root, or sync this subtree to your Space repo.

πŸ™ Credits

βš–οΈ License

This repository follows the same license as OmniVoice: Apache License 2.0. The license text is the upstream OmniVoice LICENSE. Redistribution must include that file and NOTICE (third-party and attribution).

Contributors

HarryHe11

10 commits

HarryHe11/Any2Canto

1

stars

10

commits

Python

primary language

Apr 4, 2026

updated

README

Any2Canto πŸŽ™οΈ

Any2Canto turns text in any language into natural spoken Cantonese using OmniVoice zero-shot voice cloning. Optional LLM translation produces colloquial Cantonese before synthesis; Chinese input is normalized with OpenCC (Simplified β†’ Traditional, Hong Kong glyphs).

✨ Features

  • 🌐 Multilingual input β€” Type in English, Mandarin, Japanese, Korean, etc.; non-Chinese text can be translated to colloquial Cantonese via an LLM API (when configured).
  • 🎭 Voice cloning β€” Upload 3–10 seconds of reference speech.
  • 🧭 Cantonese-first pipeline β€” OpenCC s2hk + language detection to avoid unnecessary API calls for written Chinese.

πŸ“‚ Repository layout

PathPurpose
space/Gradio app (app.py), bundled omnivoice package, and Hugging Face Space metadata (space/README.md).
space/requirements.txtPython dependencies (PyTorch + Gradio stack).

πŸš€ Quick start (local)

From the space/ directory:

cd space
pip install -r requirements.txt

Set environment variables as needed:

VariableDescription
OMNIVOICE_MODELHugging Face model id or path (default: k2-fsa/OmniVoice).
OMNIVOICE_DEVICEOptional override: cuda, mps, or cpu. If unset, uses CUDA when available, else Apple MPS, else CPU.
LLM_API_KEYAPI key for translation; if unset, translation is skipped and you can still use Cantonese / Chinese input.
LLM_BASE_URLOpenAI-compatible chat completions URL (default points to a compatible endpoint; override for your provider).
LLM_MODELModel name for translation (default: qwen3.5-flash).

Run the UI:

python app.py

πŸ’‘ Local run: python app.py starts Gradio on localhost (default URL in the terminal). Device is picked automatically (cuda β†’ mps β†’ cpu); on Mac with Apple Silicon, install PyTorch for macOS (do not use the CUDA wheel index in requirements.txtβ€”install torch / torchaudio from pytorch.org or pip install torch torchaudio on Mac). On Hugging Face Spaces, spaces provides the GPU decorator; locally the app runs without that package.

πŸ€— Hugging Face Space

The file space/README.md contains the Space configuration front matter (app_file, sdk, etc.). Point your Space repository at space/ as the app root, or sync this subtree to your Space repo.

πŸ™ Credits

βš–οΈ License

This repository follows the same license as OmniVoice: Apache License 2.0. The license text is the upstream OmniVoice LICENSE. Redistribution must include that file and NOTICE (third-party and attribution).

Contributors

HarryHe11

10 commits

Languages

Python

100.0%