Text-to-Speech
Transformers
ONNX
GGUF
Chinese
English
voice-dialogue
speech-recognition
large-language-model
asr
tts
llm
chinese
english
real-time
conversational
Instructions to use MoYoYoTech/VoiceDialogue with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MoYoYoTech/VoiceDialogue with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="MoYoYoTech/VoiceDialogue") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MoYoYoTech/VoiceDialogue", dtype="auto") - llama-cpp-python
How to use MoYoYoTech/VoiceDialogue with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MoYoYoTech/VoiceDialogue", filename="assets/models/llm/qwen/Qwen3-8B-Q6_K.gguf", )
llm.create_chat_completion( messages = "\"The answer to the universe is 42\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MoYoYoTech/VoiceDialogue with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K # Run inference directly in the terminal: llama-cli -hf MoYoYoTech/VoiceDialogue:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K # Run inference directly in the terminal: llama-cli -hf MoYoYoTech/VoiceDialogue:Q6_K
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K # Run inference directly in the terminal: ./llama-cli -hf MoYoYoTech/VoiceDialogue:Q6_K
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf MoYoYoTech/VoiceDialogue:Q6_K
Use Docker
docker model run hf.co/MoYoYoTech/VoiceDialogue:Q6_K
- LM Studio
- Jan
- Ollama
How to use MoYoYoTech/VoiceDialogue with Ollama:
ollama run hf.co/MoYoYoTech/VoiceDialogue:Q6_K
- Unsloth Studio new
How to use MoYoYoTech/VoiceDialogue with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for MoYoYoTech/VoiceDialogue to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for MoYoYoTech/VoiceDialogue to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MoYoYoTech/VoiceDialogue to start chatting
- Pi new
How to use MoYoYoTech/VoiceDialogue with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "MoYoYoTech/VoiceDialogue:Q6_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use MoYoYoTech/VoiceDialogue with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf MoYoYoTech/VoiceDialogue:Q6_K
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default MoYoYoTech/VoiceDialogue:Q6_K
Run Hermes
hermes
- Docker Model Runner
How to use MoYoYoTech/VoiceDialogue with Docker Model Runner:
docker model run hf.co/MoYoYoTech/VoiceDialogue:Q6_K
- Lemonade
How to use MoYoYoTech/VoiceDialogue with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MoYoYoTech/VoiceDialogue:Q6_K
Run and chat with the model
lemonade run user.VoiceDialogue-Q6_K
List all available models
lemonade list
liumaolin commited on
Commit ·
f08ef5f
1
Parent(s): 8acaad0
Remove trailing whitespace in `audio_generator/manager.py` and `asr/manager.py` for improved code cleanliness and consistency.
Browse files
src/VoiceDialogue/services/audio/audio_generator/manager.py
CHANGED
|
@@ -15,7 +15,7 @@ class TTSRegistryTables:
|
|
| 15 |
"""TTS注册表系统,用于管理不同的TTS实现"""
|
| 16 |
|
| 17 |
tts_classes: Dict[str, Type[TTSInterface]] = None
|
| 18 |
-
|
| 19 |
def __post_init__(self):
|
| 20 |
if self.tts_classes is None:
|
| 21 |
self.tts_classes = {}
|
|
@@ -24,7 +24,7 @@ class TTSRegistryTables:
|
|
| 24 |
"""打印已注册的TTS类"""
|
| 25 |
print("\nTTS Registry Tables: \n")
|
| 26 |
headers = ["register name", "class name", "class location"]
|
| 27 |
-
|
| 28 |
if self.tts_classes and (key is None or "tts_classes" in key):
|
| 29 |
print(f"----------- ** tts_classes ** --------------")
|
| 30 |
metas = []
|
|
@@ -40,7 +40,7 @@ class TTSRegistryTables:
|
|
| 40 |
f"{class_file}:{class_line}",
|
| 41 |
]
|
| 42 |
metas.append(meta_data)
|
| 43 |
-
|
| 44 |
metas.sort(key=lambda x: x[0])
|
| 45 |
data = [headers] + metas
|
| 46 |
col_widths = [max(len(str(item)) for item in col) for col in zip(*data)]
|
|
@@ -82,10 +82,10 @@ tts_tables = TTSRegistryTables()
|
|
| 82 |
|
| 83 |
class TTSManager:
|
| 84 |
"""TTS管理器,负责管理和创建TTS实例"""
|
| 85 |
-
|
| 86 |
def __init__(self):
|
| 87 |
self._tts_instances: Dict[str, TTSInterface] = {}
|
| 88 |
-
|
| 89 |
def create_tts(self, config: BaseTTSConfig) -> TTSInterface:
|
| 90 |
"""
|
| 91 |
根据配置创建TTS实例
|
|
@@ -100,13 +100,13 @@ class TTSManager:
|
|
| 100 |
ValueError: 如果TTS类型未注册
|
| 101 |
"""
|
| 102 |
tts_type = config.tts_type.value
|
| 103 |
-
|
| 104 |
if tts_type not in tts_tables.tts_classes:
|
| 105 |
raise ValueError(f"未注册的TTS类型: {tts_type}. 可用类型: {list(tts_tables.tts_classes.keys())}")
|
| 106 |
-
|
| 107 |
tts_class = tts_tables.tts_classes[tts_type]
|
| 108 |
return tts_class(config)
|
| 109 |
-
|
| 110 |
def get_or_create_tts(self, config: BaseTTSConfig) -> TTSInterface:
|
| 111 |
"""
|
| 112 |
获取或创建TTS实例(单例模式)
|
|
@@ -118,20 +118,20 @@ class TTSManager:
|
|
| 118 |
TTSInterface: TTS实例
|
| 119 |
"""
|
| 120 |
instance_key = f"{config.tts_type.value}:{config.character_name}"
|
| 121 |
-
|
| 122 |
if instance_key not in self._tts_instances:
|
| 123 |
self._tts_instances[instance_key] = self.create_tts(config)
|
| 124 |
-
|
| 125 |
return self._tts_instances[instance_key]
|
| 126 |
-
|
| 127 |
def list_registered_tts(self) -> Dict[str, Type[TTSInterface]]:
|
| 128 |
"""列出所有已注册的TTS类"""
|
| 129 |
return tts_tables.tts_classes.copy()
|
| 130 |
-
|
| 131 |
def is_tts_registered(self, tts_type: str) -> bool:
|
| 132 |
"""检查指定TTS类型是否已注册"""
|
| 133 |
return tts_type in tts_tables.tts_classes
|
| 134 |
-
|
| 135 |
def print_registry(self):
|
| 136 |
"""打印注册表信息"""
|
| 137 |
tts_tables.print()
|
|
@@ -146,16 +146,16 @@ def register_all_tts():
|
|
| 146 |
|
| 147 |
# 获取runtime目录路径
|
| 148 |
runtime_dir = Path(__file__).parent / "runtime"
|
| 149 |
-
|
| 150 |
# 扫描runtime目录中的Python文件
|
| 151 |
for py_file in runtime_dir.glob("*.py"):
|
| 152 |
if py_file.name in ["__init__.py", "interface.py"]:
|
| 153 |
continue
|
| 154 |
-
|
| 155 |
module_name = py_file.stem
|
| 156 |
try:
|
| 157 |
spec = importlib.util.spec_from_file_location(
|
| 158 |
-
|
| 159 |
py_file
|
| 160 |
)
|
| 161 |
module = importlib.util.module_from_spec(spec)
|
|
|
|
| 15 |
"""TTS注册表系统,用于管理不同的TTS实现"""
|
| 16 |
|
| 17 |
tts_classes: Dict[str, Type[TTSInterface]] = None
|
| 18 |
+
|
| 19 |
def __post_init__(self):
|
| 20 |
if self.tts_classes is None:
|
| 21 |
self.tts_classes = {}
|
|
|
|
| 24 |
"""打印已注册的TTS类"""
|
| 25 |
print("\nTTS Registry Tables: \n")
|
| 26 |
headers = ["register name", "class name", "class location"]
|
| 27 |
+
|
| 28 |
if self.tts_classes and (key is None or "tts_classes" in key):
|
| 29 |
print(f"----------- ** tts_classes ** --------------")
|
| 30 |
metas = []
|
|
|
|
| 40 |
f"{class_file}:{class_line}",
|
| 41 |
]
|
| 42 |
metas.append(meta_data)
|
| 43 |
+
|
| 44 |
metas.sort(key=lambda x: x[0])
|
| 45 |
data = [headers] + metas
|
| 46 |
col_widths = [max(len(str(item)) for item in col) for col in zip(*data)]
|
|
|
|
| 82 |
|
| 83 |
class TTSManager:
|
| 84 |
"""TTS管理器,负责管理和创建TTS实例"""
|
| 85 |
+
|
| 86 |
def __init__(self):
|
| 87 |
self._tts_instances: Dict[str, TTSInterface] = {}
|
| 88 |
+
|
| 89 |
def create_tts(self, config: BaseTTSConfig) -> TTSInterface:
|
| 90 |
"""
|
| 91 |
根据配置创建TTS实例
|
|
|
|
| 100 |
ValueError: 如果TTS类型未注册
|
| 101 |
"""
|
| 102 |
tts_type = config.tts_type.value
|
| 103 |
+
|
| 104 |
if tts_type not in tts_tables.tts_classes:
|
| 105 |
raise ValueError(f"未注册的TTS类型: {tts_type}. 可用类型: {list(tts_tables.tts_classes.keys())}")
|
| 106 |
+
|
| 107 |
tts_class = tts_tables.tts_classes[tts_type]
|
| 108 |
return tts_class(config)
|
| 109 |
+
|
| 110 |
def get_or_create_tts(self, config: BaseTTSConfig) -> TTSInterface:
|
| 111 |
"""
|
| 112 |
获取或创建TTS实例(单例模式)
|
|
|
|
| 118 |
TTSInterface: TTS实例
|
| 119 |
"""
|
| 120 |
instance_key = f"{config.tts_type.value}:{config.character_name}"
|
| 121 |
+
|
| 122 |
if instance_key not in self._tts_instances:
|
| 123 |
self._tts_instances[instance_key] = self.create_tts(config)
|
| 124 |
+
|
| 125 |
return self._tts_instances[instance_key]
|
| 126 |
+
|
| 127 |
def list_registered_tts(self) -> Dict[str, Type[TTSInterface]]:
|
| 128 |
"""列出所有已注册的TTS类"""
|
| 129 |
return tts_tables.tts_classes.copy()
|
| 130 |
+
|
| 131 |
def is_tts_registered(self, tts_type: str) -> bool:
|
| 132 |
"""检查指定TTS类型是否已注册"""
|
| 133 |
return tts_type in tts_tables.tts_classes
|
| 134 |
+
|
| 135 |
def print_registry(self):
|
| 136 |
"""打印注册表信息"""
|
| 137 |
tts_tables.print()
|
|
|
|
| 146 |
|
| 147 |
# 获取runtime目录路径
|
| 148 |
runtime_dir = Path(__file__).parent / "runtime"
|
| 149 |
+
|
| 150 |
# 扫描runtime目录中的Python文件
|
| 151 |
for py_file in runtime_dir.glob("*.py"):
|
| 152 |
if py_file.name in ["__init__.py", "interface.py"]:
|
| 153 |
continue
|
| 154 |
+
|
| 155 |
module_name = py_file.stem
|
| 156 |
try:
|
| 157 |
spec = importlib.util.spec_from_file_location(
|
| 158 |
+
module_name,
|
| 159 |
py_file
|
| 160 |
)
|
| 161 |
module = importlib.util.module_from_spec(spec)
|
src/VoiceDialogue/services/speech/asr/manager.py
CHANGED
|
@@ -296,7 +296,7 @@ def register_all_asr():
|
|
| 296 |
try:
|
| 297 |
# 动态导入模块
|
| 298 |
spec = importlib.util.spec_from_file_location(
|
| 299 |
-
|
| 300 |
py_file
|
| 301 |
)
|
| 302 |
module = importlib.util.module_from_spec(spec)
|
|
|
|
| 296 |
try:
|
| 297 |
# 动态导入模块
|
| 298 |
spec = importlib.util.spec_from_file_location(
|
| 299 |
+
module_name,
|
| 300 |
py_file
|
| 301 |
)
|
| 302 |
module = importlib.util.module_from_spec(spec)
|