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 ·
619c761
1
Parent(s): 2414221
Refactor imports across services: replace `services.core` module references with `core` for consistency and maintainability; remove unused `Queue` imports.
Browse files- src/VoiceDialogue/api/core/service_factories.py +3 -3
- src/VoiceDialogue/{services/core → core}/__init__.py +0 -0
- src/VoiceDialogue/{services/core → core}/base.py +0 -0
- src/VoiceDialogue/{services/core → core}/constants.py +0 -0
- src/VoiceDialogue/{services/core → core}/enums.py +1 -1
- src/VoiceDialogue/{services/core → core}/state_manager.py +0 -0
- src/VoiceDialogue/main.py +5 -5
- src/VoiceDialogue/services/audio/aec_audio_capture.py +1 -1
- src/VoiceDialogue/services/audio/audio_answer.py +2 -2
- src/VoiceDialogue/services/audio/audio_player.py +3 -4
- src/VoiceDialogue/services/core/queue.py +0 -7
- src/VoiceDialogue/services/speech/asr_service.py +2 -2
- src/VoiceDialogue/services/speech/speech_monitor.py +3 -3
- src/VoiceDialogue/services/text/text_generator.py +2 -2
src/VoiceDialogue/api/core/service_factories.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
-
from
|
| 2 |
-
from services.audio.audio_generator import BaseTTSConfig, tts_config_registry
|
| 3 |
-
from services.core.constants import (
|
| 4 |
transcribed_text_queue, text_input_queue, audio_output_queue,
|
| 5 |
audio_frames_queue, user_voice_queue
|
| 6 |
)
|
|
|
|
|
|
|
| 7 |
from services.speech import SpeechStateMonitor, ASRWorker
|
| 8 |
from services.text.text_generator import LLMResponseGenerator
|
| 9 |
from .service_manager import ServiceDefinition
|
|
|
|
| 1 |
+
from core.constants import (
|
|
|
|
|
|
|
| 2 |
transcribed_text_queue, text_input_queue, audio_output_queue,
|
| 3 |
audio_frames_queue, user_voice_queue
|
| 4 |
)
|
| 5 |
+
from services.audio import EchoCancellingAudioCapture, TTSAudioGenerator, AudioStreamPlayer
|
| 6 |
+
from services.audio.audio_generator import BaseTTSConfig, tts_config_registry
|
| 7 |
from services.speech import SpeechStateMonitor, ASRWorker
|
| 8 |
from services.text.text_generator import LLMResponseGenerator
|
| 9 |
from .service_manager import ServiceDefinition
|
src/VoiceDialogue/{services/core → core}/__init__.py
RENAMED
|
File without changes
|
src/VoiceDialogue/{services/core → core}/base.py
RENAMED
|
File without changes
|
src/VoiceDialogue/{services/core → core}/constants.py
RENAMED
|
File without changes
|
src/VoiceDialogue/{services/core → core}/enums.py
RENAMED
|
@@ -4,4 +4,4 @@ import enum
|
|
| 4 |
class AudioState(enum.Enum):
|
| 5 |
"""音频播放状态枚举"""
|
| 6 |
DROP = 0
|
| 7 |
-
PLAYING = 1
|
|
|
|
| 4 |
class AudioState(enum.Enum):
|
| 5 |
"""音频播放状态枚举"""
|
| 6 |
DROP = 0
|
| 7 |
+
PLAYING = 1
|
src/VoiceDialogue/{services/core → core}/state_manager.py
RENAMED
|
File without changes
|
src/VoiceDialogue/main.py
CHANGED
|
@@ -5,17 +5,17 @@ from pathlib import Path
|
|
| 5 |
|
| 6 |
import uvicorn
|
| 7 |
|
| 8 |
-
from
|
| 9 |
-
from services.audio.audio_answer import TTSAudioGenerator
|
| 10 |
-
from services.audio.audio_generator.models import tts_config_registry, TTSConfigType
|
| 11 |
-
from services.audio.audio_player import AudioStreamPlayer
|
| 12 |
-
from services.core.constants import (
|
| 13 |
audio_frames_queue,
|
| 14 |
user_voice_queue,
|
| 15 |
transcribed_text_queue,
|
| 16 |
text_input_queue,
|
| 17 |
audio_output_queue
|
| 18 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
from services.speech.asr_service import ASRWorker
|
| 20 |
from services.speech.speech_monitor import SpeechStateMonitor
|
| 21 |
from services.text.text_generator import LLMResponseGenerator
|
|
|
|
| 5 |
|
| 6 |
import uvicorn
|
| 7 |
|
| 8 |
+
from core.constants import (
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
audio_frames_queue,
|
| 10 |
user_voice_queue,
|
| 11 |
transcribed_text_queue,
|
| 12 |
text_input_queue,
|
| 13 |
audio_output_queue
|
| 14 |
)
|
| 15 |
+
from services.audio.aec_audio_capture import EchoCancellingAudioCapture
|
| 16 |
+
from services.audio.audio_answer import TTSAudioGenerator
|
| 17 |
+
from services.audio.audio_generator.models import tts_config_registry
|
| 18 |
+
from services.audio.audio_player import AudioStreamPlayer
|
| 19 |
from services.speech.asr_service import ASRWorker
|
| 20 |
from services.speech.speech_monitor import SpeechStateMonitor
|
| 21 |
from services.text.text_generator import LLMResponseGenerator
|
src/VoiceDialogue/services/audio/aec_audio_capture.py
CHANGED
|
@@ -9,7 +9,7 @@ import time
|
|
| 9 |
import numpy as np
|
| 10 |
|
| 11 |
from config.paths import LIBRARIES_PATH
|
| 12 |
-
from
|
| 13 |
|
| 14 |
|
| 15 |
class EchoCancellingAudioCapture(BaseThread):
|
|
|
|
| 9 |
import numpy as np
|
| 10 |
|
| 11 |
from config.paths import LIBRARIES_PATH
|
| 12 |
+
from core.base import BaseThread
|
| 13 |
|
| 14 |
|
| 15 |
class EchoCancellingAudioCapture(BaseThread):
|
src/VoiceDialogue/services/audio/audio_answer.py
CHANGED
|
@@ -2,9 +2,9 @@ import time
|
|
| 2 |
from multiprocessing import Queue
|
| 3 |
from queue import Empty
|
| 4 |
|
|
|
|
|
|
|
| 5 |
from models.voice_task import VoiceTask
|
| 6 |
-
from services.core.base import BaseThread
|
| 7 |
-
from services.core.constants import dropped_audio_cache, user_still_speaking_event, voice_state_manager
|
| 8 |
from .audio_generator import tts_manager, BaseTTSConfig
|
| 9 |
|
| 10 |
|
|
|
|
| 2 |
from multiprocessing import Queue
|
| 3 |
from queue import Empty
|
| 4 |
|
| 5 |
+
from core.base import BaseThread
|
| 6 |
+
from core.constants import dropped_audio_cache, user_still_speaking_event, voice_state_manager
|
| 7 |
from models.voice_task import VoiceTask
|
|
|
|
|
|
|
| 8 |
from .audio_generator import tts_manager, BaseTTSConfig
|
| 9 |
|
| 10 |
|
src/VoiceDialogue/services/audio/audio_player.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import tempfile
|
| 2 |
-
import time
|
| 3 |
from collections import OrderedDict
|
| 4 |
from multiprocessing import Queue
|
| 5 |
from queue import Empty
|
|
@@ -7,12 +6,12 @@ from queue import Empty
|
|
| 7 |
import soundfile as sf
|
| 8 |
from playsound import playsound
|
| 9 |
|
| 10 |
-
from
|
| 11 |
-
from
|
| 12 |
-
from services.core.constants import (
|
| 13 |
user_still_speaking_event, voice_state_manager, dropped_audio_cache, chat_history_cache,
|
| 14 |
silence_over_threshold_event
|
| 15 |
)
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
class AudioStreamPlayer(BaseThread):
|
|
|
|
| 1 |
import tempfile
|
|
|
|
| 2 |
from collections import OrderedDict
|
| 3 |
from multiprocessing import Queue
|
| 4 |
from queue import Empty
|
|
|
|
| 6 |
import soundfile as sf
|
| 7 |
from playsound import playsound
|
| 8 |
|
| 9 |
+
from core.base import BaseThread
|
| 10 |
+
from core.constants import (
|
|
|
|
| 11 |
user_still_speaking_event, voice_state_manager, dropped_audio_cache, chat_history_cache,
|
| 12 |
silence_over_threshold_event
|
| 13 |
)
|
| 14 |
+
from models.voice_task import VoiceTask
|
| 15 |
|
| 16 |
|
| 17 |
class AudioStreamPlayer(BaseThread):
|
src/VoiceDialogue/services/core/queue.py
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
from multiprocessing import Queue
|
| 2 |
-
|
| 3 |
-
audio_frames_queue = Queue()
|
| 4 |
-
user_voice_queue = Queue()
|
| 5 |
-
transcribed_text_queue = Queue()
|
| 6 |
-
generated_answer_queue = Queue()
|
| 7 |
-
tts_generated_audio_queue = Queue()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/VoiceDialogue/services/speech/asr_service.py
CHANGED
|
@@ -4,9 +4,9 @@ from queue import Queue
|
|
| 4 |
|
| 5 |
import numpy as np
|
| 6 |
|
|
|
|
|
|
|
| 7 |
from models.voice_task import VoiceTask
|
| 8 |
-
from services.core.base import BaseThread
|
| 9 |
-
from services.core.constants import user_still_speaking_event, voice_state_manager, dropped_audio_cache
|
| 10 |
from utils.cache import LRUCacheDict
|
| 11 |
from .asr import asr_manager
|
| 12 |
|
|
|
|
| 4 |
|
| 5 |
import numpy as np
|
| 6 |
|
| 7 |
+
from core.base import BaseThread
|
| 8 |
+
from core.constants import user_still_speaking_event, voice_state_manager, dropped_audio_cache
|
| 9 |
from models.voice_task import VoiceTask
|
|
|
|
|
|
|
| 10 |
from utils.cache import LRUCacheDict
|
| 11 |
from .asr import asr_manager
|
| 12 |
|
src/VoiceDialogue/services/speech/speech_monitor.py
CHANGED
|
@@ -14,11 +14,11 @@ import librosa
|
|
| 14 |
import numpy as np
|
| 15 |
|
| 16 |
from models.voice_task import VoiceTask
|
| 17 |
-
from
|
| 18 |
-
from
|
| 19 |
voice_state_manager, silence_over_threshold_event, user_still_speaking_event, current_session_id
|
| 20 |
)
|
| 21 |
-
from
|
| 22 |
|
| 23 |
|
| 24 |
class SpeechMonitorConfig:
|
|
|
|
| 14 |
import numpy as np
|
| 15 |
|
| 16 |
from models.voice_task import VoiceTask
|
| 17 |
+
from core.base import BaseThread
|
| 18 |
+
from core.constants import (
|
| 19 |
voice_state_manager, silence_over_threshold_event, user_still_speaking_event, current_session_id
|
| 20 |
)
|
| 21 |
+
from core.enums import AudioState
|
| 22 |
|
| 23 |
|
| 24 |
class SpeechMonitorConfig:
|
src/VoiceDialogue/services/text/text_generator.py
CHANGED
|
@@ -6,9 +6,9 @@ from langchain.memory import ConversationBufferWindowMemory
|
|
| 6 |
from langchain_core.chat_history import InMemoryChatMessageHistory
|
| 7 |
|
| 8 |
from config import paths
|
|
|
|
|
|
|
| 9 |
from models.voice_task import VoiceTask
|
| 10 |
-
from services.core.base import BaseThread
|
| 11 |
-
from services.core.constants import chat_history_cache
|
| 12 |
from services.text.langchain_llm import preprocess_sentence_text, \
|
| 13 |
create_langchain_chat_llamacpp_instance, create_langchain_pipeline, warmup_langchain_pipeline
|
| 14 |
|
|
|
|
| 6 |
from langchain_core.chat_history import InMemoryChatMessageHistory
|
| 7 |
|
| 8 |
from config import paths
|
| 9 |
+
from core.base import BaseThread
|
| 10 |
+
from core.constants import chat_history_cache
|
| 11 |
from models.voice_task import VoiceTask
|
|
|
|
|
|
|
| 12 |
from services.text.langchain_llm import preprocess_sentence_text, \
|
| 13 |
create_langchain_chat_llamacpp_instance, create_langchain_pipeline, warmup_langchain_pipeline
|
| 14 |
|