-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add VoxCPM TTS engine and update router #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9665d79
feat: add VoxCPM TTS engine and update router
phonk2682 667490d
refactor(api): simplify TTS response and add explicit serialization
phonk2682 7701661
Refactor: Move numpy_to_wav_bytes to AudioProcessor
phonk2682 358b392
refactor(tts): Return engine result directly
phonk2682 a118448
Refactor: Use model_dump_json for TTS serialization
phonk2682 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # VoxCPM TTS Engine | ||
| from app.engines.tts.voxcpm.config import VoxCPMConfig | ||
| from app.engines.tts.voxcpm.engine import VoxCPMEngine | ||
|
|
||
| __all__ = ["VoxCPMConfig", "VoxCPMEngine"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| """ | ||
| VoxCPM TTS Engine Configuration | ||
|
|
||
| Configuration class for VoxCPM - a tokenizer-free TTS system with voice cloning support. | ||
| """ | ||
|
|
||
| from pydantic import Field | ||
|
|
||
| from app.models.engine import EngineConfig | ||
|
|
||
|
|
||
| class VoxCPMConfig(EngineConfig): | ||
| """ | ||
| Configuration for VoxCPM TTS Engine | ||
|
|
||
| Attributes: | ||
| model_name: HuggingFace model ID (e.g., "openbmb/VoxCPM-0.5B", "openbmb/VoxCPM1.5") | ||
| device: Device to run on ("cpu", "cuda", "mps") | ||
| cfg_value: LM guidance value for LocDiT (higher = better adherence to prompt) | ||
| inference_timesteps: LocDiT inference timesteps (higher = better quality, slower) | ||
| normalize: Enable external text normalization tool | ||
| denoise: Enable external denoiser (restricts output to 16kHz) | ||
| retry_badcase: Enable retrying mode for bad cases (unstoppable generation) | ||
| retry_badcase_max_times: Maximum retry attempts for bad cases | ||
| retry_badcase_ratio_threshold: Length restriction threshold for bad case detection | ||
| """ | ||
|
|
||
| # VoxCPM-specific settings | ||
| cfg_value: float = Field( | ||
| default=2.0, | ||
| ge=0.0, | ||
| description="LM guidance on LocDiT, higher for better adherence to prompt", | ||
| ) | ||
| inference_timesteps: int = Field( | ||
| default=10, | ||
| ge=1, | ||
| le=50, | ||
| description="LocDiT inference timesteps, higher for better quality", | ||
| ) | ||
| normalize: bool = Field( | ||
| default=False, | ||
| description="Enable external text normalization tool", | ||
| ) | ||
| denoise: bool = Field( | ||
| default=False, | ||
| description="Enable external denoiser (restricts to 16kHz)", | ||
| ) | ||
| retry_badcase: bool = Field( | ||
| default=True, | ||
| description="Enable retrying mode for bad cases", | ||
| ) | ||
| retry_badcase_max_times: int = Field( | ||
| default=3, | ||
| ge=1, | ||
| description="Maximum retry attempts for bad cases", | ||
| ) | ||
| retry_badcase_ratio_threshold: float = Field( | ||
| default=6.0, | ||
| ge=1.0, | ||
| description="Length restriction threshold for bad case detection", | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.