Instructions to use MoYoYoTech/Translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use MoYoYoTech/Translator with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MoYoYoTech/Translator", filename="moyoyo_asr_models/qwen2.5-1.5b-instruct-q5_0.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MoYoYoTech/Translator with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoYoYoTech/Translator:Q5_0 # Run inference directly in the terminal: llama-cli -hf MoYoYoTech/Translator:Q5_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MoYoYoTech/Translator:Q5_0 # Run inference directly in the terminal: llama-cli -hf MoYoYoTech/Translator:Q5_0
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/Translator:Q5_0 # Run inference directly in the terminal: ./llama-cli -hf MoYoYoTech/Translator:Q5_0
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/Translator:Q5_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf MoYoYoTech/Translator:Q5_0
Use Docker
docker model run hf.co/MoYoYoTech/Translator:Q5_0
- LM Studio
- Jan
- Ollama
How to use MoYoYoTech/Translator with Ollama:
ollama run hf.co/MoYoYoTech/Translator:Q5_0
- Unsloth Studio new
How to use MoYoYoTech/Translator 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/Translator 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/Translator to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MoYoYoTech/Translator to start chatting
- Pi new
How to use MoYoYoTech/Translator with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf MoYoYoTech/Translator:Q5_0
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/Translator:Q5_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use MoYoYoTech/Translator 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/Translator:Q5_0
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/Translator:Q5_0
Run Hermes
hermes
- Docker Model Runner
How to use MoYoYoTech/Translator with Docker Model Runner:
docker model run hf.co/MoYoYoTech/Translator:Q5_0
- Lemonade
How to use MoYoYoTech/Translator with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MoYoYoTech/Translator:Q5_0
Run and chat with the model
lemonade run user.Translator-Q5_0
List all available models
lemonade list
| import pathlib | |
| import re | |
| import logging | |
| import json | |
| DEBUG = False | |
| LOG_LEVEL = logging.DEBUG if DEBUG else logging.WARNING | |
| logging.getLogger("pywhispercpp").setLevel(logging.WARNING) | |
| logging.basicConfig( | |
| level=LOG_LEVEL, | |
| format="%(asctime)s - %(levelname)s - %(message)s", | |
| filename='translator.log', | |
| datefmt="%H:%M:%S" | |
| ) | |
| SAVE_DATA_SAVE = False | |
| console_handler = logging.StreamHandler() | |
| console_handler.setLevel(LOG_LEVEL) | |
| console_formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") | |
| console_handler.setFormatter(console_formatter) | |
| logging.getLogger().addHandler(console_handler) | |
| # 音频段的决策时间 | |
| FRAME_SCOPE_TIME_THRESHOLD = 6 | |
| # 最长语音时长 | |
| MAX_SPEECH_DURATION_S = 15 | |
| BASE_DIR = pathlib.Path(__file__).parent.parent | |
| MODEL_DIR = BASE_DIR / "moyoyo_asr_models" | |
| ASSERT_DIR = BASE_DIR / "assets" | |
| CONFIG_DIR = BASE_DIR / "config" | |
| SAMPLE_RATE = 16000 | |
| # 标点 | |
| SENTENCE_END_MARKERS = ['.', '!', '?', '。', '!', '?', ';', ';', ':', ':'] | |
| PAUSE_END_MARKERS = [',', ',', '、'] | |
| # 合并所有标点 | |
| ALL_MARKERS = SENTENCE_END_MARKERS + PAUSE_END_MARKERS | |
| # 构造正则表达式字符类 | |
| REGEX_MARKERS = re.compile(r'[' + re.escape(''.join(ALL_MARKERS)) + r']$') | |
| sentence_end_chars = ''.join([re.escape(char) for char in SENTENCE_END_MARKERS]) | |
| SENTENCE_END_PATTERN = re.compile(f'[{sentence_end_chars}]') | |
| # Method 2: Alternative approach with a character class | |
| pattern_string = '[' + ''.join([re.escape(char) for char in PAUSE_END_MARKERS]) + r']$' | |
| PAUSE_END_PATTERN = re.compile(pattern_string) | |
| # whisper推理参数 | |
| WHISPER_PROMPT_ZH = "以下是简体中文普通话的句子。" | |
| MAX_LENGTH_ZH = 4 | |
| WHISPER_PROMPT_EN = "" # "The following is an English sentence." | |
| MAX_LENGTH_EN = 8 | |
| # WHISPER_MODEL_EN = 'medium-q5_0' | |
| WHISPER_MODEL_EN = 'large-v3-turbo-q5_0' | |
| # WHISPER_MODEL_ZH = 'small' | |
| WHISPER_MODEL_ZH = 'large-v3-turbo-q5_0' | |
| # LLM | |
| LLM_MODEL_PATH = (MODEL_DIR / "qwen2.5-1.5b-instruct-q5_0.gguf").as_posix() | |
| LLM_LARGE_MODEL_PATH = (MODEL_DIR / "qwen2.5-1.5b-instruct-q5_0.gguf").as_posix() | |
| # LLM_LARGE_MODEL_PATH = (MODEL_DIR / "qwen2.5-7b-instruct-q5_0-00001-of-00002.gguf").as_posix() | |
| # VAD | |
| VAD_MODEL_PATH = (MODEL_DIR / "silero-vad" / "silero_vad.onnx").as_posix() | |