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 ·
037e5ae
1
Parent(s): 8366d25
Refactor speech recognizer, audio capture, and system routes for improved clarity and functionality
Browse files- Update `speech/recognizer.py` to handle empty queue exceptions.
- Replace `pause_event` with `_pause_event` in `audio/capture.py` for consistency.
- Cleanup and standardize formatting in `system_routes.py`.
src/voice_dialogue/api/routes/system_routes.py
CHANGED
|
@@ -219,13 +219,13 @@ async def pause_system(request: Request):
|
|
| 219 |
success=False,
|
| 220 |
message="系统未启动,无法暂停"
|
| 221 |
)
|
| 222 |
-
|
| 223 |
if _system_status["status"] == "paused":
|
| 224 |
return SystemResponse(
|
| 225 |
success=False,
|
| 226 |
message="系统已经暂停"
|
| 227 |
)
|
| 228 |
-
|
| 229 |
if _system_status["status"] in ["starting", "stopping"]:
|
| 230 |
return SystemResponse(
|
| 231 |
success=False,
|
|
@@ -294,19 +294,19 @@ async def resume_system(request: Request):
|
|
| 294 |
success=False,
|
| 295 |
message="系统未启动,请先启动系统"
|
| 296 |
)
|
| 297 |
-
|
| 298 |
if _system_status["status"] == "running":
|
| 299 |
return SystemResponse(
|
| 300 |
success=False,
|
| 301 |
message="系统已经在运行中"
|
| 302 |
)
|
| 303 |
-
|
| 304 |
if _system_status["status"] in ["starting", "stopping"]:
|
| 305 |
return SystemResponse(
|
| 306 |
success=False,
|
| 307 |
message="系统正在启动或停止中,请稍后再试"
|
| 308 |
)
|
| 309 |
-
|
| 310 |
if _system_status["status"] != "paused":
|
| 311 |
return SystemResponse(
|
| 312 |
success=False,
|
|
@@ -360,4 +360,4 @@ async def resume_system(request: Request):
|
|
| 360 |
# 恢复状态
|
| 361 |
if _system_status["status"] == "running":
|
| 362 |
_system_status["status"] = "paused"
|
| 363 |
-
raise HTTPException(status_code=500, detail=f"恢复语音对话系统失败: {str(e)}")
|
|
|
|
| 219 |
success=False,
|
| 220 |
message="系统未启动,无法暂停"
|
| 221 |
)
|
| 222 |
+
|
| 223 |
if _system_status["status"] == "paused":
|
| 224 |
return SystemResponse(
|
| 225 |
success=False,
|
| 226 |
message="系统已经暂停"
|
| 227 |
)
|
| 228 |
+
|
| 229 |
if _system_status["status"] in ["starting", "stopping"]:
|
| 230 |
return SystemResponse(
|
| 231 |
success=False,
|
|
|
|
| 294 |
success=False,
|
| 295 |
message="系统未启动,请先启动系统"
|
| 296 |
)
|
| 297 |
+
|
| 298 |
if _system_status["status"] == "running":
|
| 299 |
return SystemResponse(
|
| 300 |
success=False,
|
| 301 |
message="系统已经在运行中"
|
| 302 |
)
|
| 303 |
+
|
| 304 |
if _system_status["status"] in ["starting", "stopping"]:
|
| 305 |
return SystemResponse(
|
| 306 |
success=False,
|
| 307 |
message="系统正在启动或停止中,请稍后再试"
|
| 308 |
)
|
| 309 |
+
|
| 310 |
if _system_status["status"] != "paused":
|
| 311 |
return SystemResponse(
|
| 312 |
success=False,
|
|
|
|
| 360 |
# 恢复状态
|
| 361 |
if _system_status["status"] == "running":
|
| 362 |
_system_status["status"] = "paused"
|
| 363 |
+
raise HTTPException(status_code=500, detail=f"恢复语音对话系统失败: {str(e)}")
|
src/voice_dialogue/services/audio/capture.py
CHANGED
|
@@ -4,8 +4,8 @@
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
import ctypes
|
| 7 |
-
import time
|
| 8 |
import threading
|
|
|
|
| 9 |
|
| 10 |
import numpy as np
|
| 11 |
|
|
@@ -24,17 +24,17 @@ class EchoCancellingAudioCapture(BaseThread):
|
|
| 24 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 25 |
|
| 26 |
self.audio_frames_queue = audio_frames_queue
|
| 27 |
-
self.
|
| 28 |
-
|
| 29 |
@property
|
| 30 |
def is_paused(self):
|
| 31 |
-
return self.
|
| 32 |
|
| 33 |
def pause(self):
|
| 34 |
-
self.
|
| 35 |
-
|
| 36 |
def resume(self):
|
| 37 |
-
self.
|
| 38 |
|
| 39 |
def run(self):
|
| 40 |
"""主运行循环,持续获取音频数据"""
|
|
|
|
| 4 |
"""
|
| 5 |
|
| 6 |
import ctypes
|
|
|
|
| 7 |
import threading
|
| 8 |
+
import time
|
| 9 |
|
| 10 |
import numpy as np
|
| 11 |
|
|
|
|
| 24 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 25 |
|
| 26 |
self.audio_frames_queue = audio_frames_queue
|
| 27 |
+
self._pause_event = threading.Event()
|
| 28 |
+
|
| 29 |
@property
|
| 30 |
def is_paused(self):
|
| 31 |
+
return self._pause_event.is_set()
|
| 32 |
|
| 33 |
def pause(self):
|
| 34 |
+
self._pause_event.set()
|
| 35 |
+
|
| 36 |
def resume(self):
|
| 37 |
+
self._pause_event.clear()
|
| 38 |
|
| 39 |
def run(self):
|
| 40 |
"""主运行循环,持续获取音频数据"""
|
src/voice_dialogue/services/speech/recognizer.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import time
|
| 2 |
import typing
|
| 3 |
-
from queue import Queue
|
| 4 |
|
| 5 |
import numpy as np
|
| 6 |
|
|
@@ -15,7 +15,7 @@ class ASRWorker(BaseThread):
|
|
| 15 |
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None,
|
| 16 |
user_voice_queue: Queue,
|
| 17 |
transcribed_text_queue: Queue,
|
| 18 |
-
language: typing.Literal["auto", "zh", "en"]
|
| 19 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 20 |
|
| 21 |
self.language = language
|
|
@@ -32,7 +32,11 @@ class ASRWorker(BaseThread):
|
|
| 32 |
self.is_ready = True
|
| 33 |
|
| 34 |
while not self.stopped():
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
voice_task.language = self.language
|
| 37 |
voice_task.whisper_start_time = time.time()
|
| 38 |
user_voice: np.array = voice_task.user_voice
|
|
|
|
| 1 |
import time
|
| 2 |
import typing
|
| 3 |
+
from queue import Queue, Empty
|
| 4 |
|
| 5 |
import numpy as np
|
| 6 |
|
|
|
|
| 15 |
def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None,
|
| 16 |
user_voice_queue: Queue,
|
| 17 |
transcribed_text_queue: Queue,
|
| 18 |
+
language: typing.Literal["auto", "zh", "en"]):
|
| 19 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 20 |
|
| 21 |
self.language = language
|
|
|
|
| 32 |
self.is_ready = True
|
| 33 |
|
| 34 |
while not self.stopped():
|
| 35 |
+
try:
|
| 36 |
+
voice_task: VoiceTask = self.user_voice_queue.get(block=False, timeout=0.1)
|
| 37 |
+
except Empty:
|
| 38 |
+
continue
|
| 39 |
+
|
| 40 |
voice_task.language = self.language
|
| 41 |
voice_task.whisper_start_time = time.time()
|
| 42 |
user_voice: np.array = voice_task.user_voice
|