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")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MoYoYoTech/VoiceDialogue", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MoYoYoTech/VoiceDialogue with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -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 serve -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 Desktop
- Pi
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 serve -hf MoYoYoTech/VoiceDialogue:Q6_K
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/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
- 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
- Hermes Agent
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 serve -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
- Atomic Chat
- OpenClaw
How to use MoYoYoTech/VoiceDialogue with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MoYoYoTech/VoiceDialogue:Q6_K
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "MoYoYoTech/VoiceDialogue:Q6_K" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
liumaolin commited on
Commit ·
7437d6d
1
Parent(s): 7bff52e
Refactor to replace `EchoCancellingAudioCapture` with `AudioCapture` across the codebase for improved clarity and flexibility
Browse files
src/voice_dialogue/__init__.py
CHANGED
|
@@ -5,7 +5,7 @@ from .core.constants import (
|
|
| 5 |
text_input_queue,
|
| 6 |
audio_output_queue
|
| 7 |
)
|
| 8 |
-
from .services.audio.capture import
|
| 9 |
from .services.audio.generator import TTSAudioGenerator
|
| 10 |
from .services.audio.generators.models import tts_config_registry
|
| 11 |
from .services.audio.player import AudioStreamPlayer
|
|
|
|
| 5 |
text_input_queue,
|
| 6 |
audio_output_queue
|
| 7 |
)
|
| 8 |
+
from .services.audio.capture import AudioCapture
|
| 9 |
from .services.audio.generator import TTSAudioGenerator
|
| 10 |
from .services.audio.generators.models import tts_config_registry
|
| 11 |
from .services.audio.player import AudioStreamPlayer
|
src/voice_dialogue/api/core/service_factories.py
CHANGED
|
@@ -2,7 +2,7 @@ from voice_dialogue.core.constants import (
|
|
| 2 |
transcribed_text_queue, text_input_queue, audio_output_queue,
|
| 3 |
audio_frames_queue, user_voice_queue, websocket_message_queue
|
| 4 |
)
|
| 5 |
-
from voice_dialogue.services.audio import
|
| 6 |
from voice_dialogue.services.audio.generators import BaseTTSConfig, tts_config_registry
|
| 7 |
from voice_dialogue.services.speech import SpeechStateMonitor, ASRWorker
|
| 8 |
from voice_dialogue.services.text.generator import LLMResponseGenerator
|
|
@@ -13,9 +13,9 @@ class ServiceFactories:
|
|
| 13 |
"""服务工厂类,封装所有服务的创建逻辑"""
|
| 14 |
|
| 15 |
@staticmethod
|
| 16 |
-
def create_audio_capture() ->
|
| 17 |
"""创建音频捕获服务"""
|
| 18 |
-
return
|
| 19 |
audio_frames_queue=audio_frames_queue
|
| 20 |
)
|
| 21 |
|
|
|
|
| 2 |
transcribed_text_queue, text_input_queue, audio_output_queue,
|
| 3 |
audio_frames_queue, user_voice_queue, websocket_message_queue
|
| 4 |
)
|
| 5 |
+
from voice_dialogue.services.audio import AudioCapture, TTSAudioGenerator, AudioStreamPlayer
|
| 6 |
from voice_dialogue.services.audio.generators import BaseTTSConfig, tts_config_registry
|
| 7 |
from voice_dialogue.services.speech import SpeechStateMonitor, ASRWorker
|
| 8 |
from voice_dialogue.services.text.generator import LLMResponseGenerator
|
|
|
|
| 13 |
"""服务工厂类,封装所有服务的创建逻辑"""
|
| 14 |
|
| 15 |
@staticmethod
|
| 16 |
+
def create_audio_capture() -> AudioCapture:
|
| 17 |
"""创建音频捕获服务"""
|
| 18 |
+
return AudioCapture(
|
| 19 |
audio_frames_queue=audio_frames_queue
|
| 20 |
)
|
| 21 |
|
src/voice_dialogue/core/launcher.py
CHANGED
|
@@ -14,7 +14,7 @@ from voice_dialogue.core.constants import (
|
|
| 14 |
text_input_queue,
|
| 15 |
audio_output_queue
|
| 16 |
)
|
| 17 |
-
from voice_dialogue.services.audio.capture import
|
| 18 |
from voice_dialogue.services.audio.generator import TTSAudioGenerator
|
| 19 |
from voice_dialogue.services.audio.player import AudioStreamPlayer
|
| 20 |
from voice_dialogue.services.speech.monitor import SpeechStateMonitor
|
|
@@ -61,7 +61,7 @@ def launch_system(
|
|
| 61 |
threads = []
|
| 62 |
|
| 63 |
# 音频采集
|
| 64 |
-
audio_frame_probe =
|
| 65 |
audio_frame_probe.start()
|
| 66 |
threads.append(audio_frame_probe)
|
| 67 |
|
|
|
|
| 14 |
text_input_queue,
|
| 15 |
audio_output_queue
|
| 16 |
)
|
| 17 |
+
from voice_dialogue.services.audio.capture import AudioCapture
|
| 18 |
from voice_dialogue.services.audio.generator import TTSAudioGenerator
|
| 19 |
from voice_dialogue.services.audio.player import AudioStreamPlayer
|
| 20 |
from voice_dialogue.services.speech.monitor import SpeechStateMonitor
|
|
|
|
| 61 |
threads = []
|
| 62 |
|
| 63 |
# 音频采集
|
| 64 |
+
audio_frame_probe = AudioCapture(audio_frames_queue=audio_frames_queue)
|
| 65 |
audio_frame_probe.start()
|
| 66 |
threads.append(audio_frame_probe)
|
| 67 |
|
src/voice_dialogue/services/audio/__init__.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
-
from .capture import
|
| 2 |
from .generator import TTSAudioGenerator
|
| 3 |
from .player import AudioStreamPlayer
|
| 4 |
|
| 5 |
__all__ = (
|
| 6 |
-
"
|
| 7 |
"TTSAudioGenerator",
|
| 8 |
"AudioStreamPlayer",
|
| 9 |
)
|
|
|
|
| 1 |
+
from .capture import AudioCapture
|
| 2 |
from .generator import TTSAudioGenerator
|
| 3 |
from .player import AudioStreamPlayer
|
| 4 |
|
| 5 |
__all__ = (
|
| 6 |
+
"AudioCapture",
|
| 7 |
"TTSAudioGenerator",
|
| 8 |
"AudioStreamPlayer",
|
| 9 |
)
|
src/voice_dialogue/services/audio/capture.py
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
import ctypes
|
| 7 |
import threading
|
| 8 |
import time
|
|
|
|
| 9 |
|
| 10 |
import numpy as np
|
| 11 |
|
|
@@ -14,18 +15,22 @@ from voice_dialogue.core.base import BaseThread
|
|
| 14 |
from voice_dialogue.utils.logger import logger
|
| 15 |
|
| 16 |
|
| 17 |
-
class
|
| 18 |
"""
|
| 19 |
回声消除音频捕获器
|
| 20 |
使用原生 C 库进行音频捕获,支持回声消除和语音活动检测
|
| 21 |
"""
|
| 22 |
|
| 23 |
-
def __init__(
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
| 25 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 26 |
|
| 27 |
self.audio_frames_queue = audio_frames_queue
|
| 28 |
self._pause_event = threading.Event()
|
|
|
|
| 29 |
|
| 30 |
@property
|
| 31 |
def is_paused(self):
|
|
|
|
| 6 |
import ctypes
|
| 7 |
import threading
|
| 8 |
import time
|
| 9 |
+
from multiprocessing import Queue
|
| 10 |
|
| 11 |
import numpy as np
|
| 12 |
|
|
|
|
| 15 |
from voice_dialogue.utils.logger import logger
|
| 16 |
|
| 17 |
|
| 18 |
+
class AudioCapture(BaseThread):
|
| 19 |
"""
|
| 20 |
回声消除音频捕获器
|
| 21 |
使用原生 C 库进行音频捕获,支持回声消除和语音活动检测
|
| 22 |
"""
|
| 23 |
|
| 24 |
+
def __init__(
|
| 25 |
+
self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None,
|
| 26 |
+
audio_frames_queue: Queue = None,
|
| 27 |
+
enable_echo_cancellation: bool = True,
|
| 28 |
+
):
|
| 29 |
super().__init__(group, target, name, args, kwargs, daemon=daemon)
|
| 30 |
|
| 31 |
self.audio_frames_queue = audio_frames_queue
|
| 32 |
self._pause_event = threading.Event()
|
| 33 |
+
self._enable_echo_cancellation = enable_echo_cancellation
|
| 34 |
|
| 35 |
@property
|
| 36 |
def is_paused(self):
|