Instructions to use MoYoYoTech/Translator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MoYoYoTech/Translator 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/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 serve -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/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -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
- Llama new
- LM Studio
- Jan
- Ollama
How to use MoYoYoTech/Translator with Ollama:
ollama run hf.co/MoYoYoTech/Translator:Q5_0
- Unsloth Desktop
- Pi
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 serve -hf MoYoYoTech/Translator:Q5_0
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "MoYoYoTech/Translator:Q5_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- 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
- Hermes Agent
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 serve -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:9931/v1 hermes config set model.default MoYoYoTech/Translator:Q5_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MoYoYoTech/Translator with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MoYoYoTech/Translator:Q5_0
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:9931/v1 \ --custom-model-id "MoYoYoTech/Translator:Q5_0" \ --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"
daihui.zhang commited on
Commit ·
69bc449
1
Parent(s): d4a5f4a
add translate
Browse files115 unmodified lines11611711811912012112211 unmodified lines13413513613713813914014114214314414514614750 unmodified lines1981992001931942012022032042055 unmodified lines21121221320620721421521621727 unmodified lines24524624724124824925030 unmodified lines2812822832782842852862812872882892 unmodified lines29229329429029529629729827 unmodified lines32632732832432532933033133 unmodified lines3653663673653683693703713 unmodified lines3753763773753783793803815 unmodified lines387388389387390391392393115 unmodified lines whisper_model = None llm_model = None vad_model = None init_event = None
@classmethod def initializer(cls, event:mp.Event, warmup=True):11 unmodified lines # init llamacpp cls.llm_model = QwenTranslator(config.LLM_MODEL_PATH, config.LLM_SYS_PROMPT) cls.vad_model = VoiceActivityDetector() cls.init_event = event event.set() @classmethod def init(cls): pass @classmethod def warmup(cls, warmup_steps=1):50 unmodified lines # 进程初始化后再开始收音频 self._ready_state = mp.Event() self._pool = PPool( max_workers=1, initializer=partial(PywhisperInference.initializer, event=self._ready_state)) max_workers=1, initializer=PywhisperInference.initializer, initargs=(self._ready_state, )) self._pool.submit(PywhisperInference.init_event) logger.info('Create a process to process audio.') self.send_ready_state() # self.load_frame_thread = threading.Thread(target=self.load_frame_from_queue)5 unmodified lines self.trans_thread.start()
def send_ready_state(self): while not self._ready_state: time.sleep(0.1) self._ready_state.wait() self.websocket.send(json.dumps({ "uid": self.client_uid,27 unmodified lines else: self.frames_np = np.append(self.frames_np,frame_np)
def update_audio_buffer(self, last_offset): with self.lock:30 unmodified lines markers = config.PAUSE_END_MARKERS is_end = False else: # 使用句号 问好等长句结尾符号作为判断 # 使用句号 长句结尾符号作为判断 markers = config.SENTENCE_END_MARKERS is_end = True
for idx, seg in enumerate(segments): left_watch_sequences.append(seg)2 unmodified lines rest_buffer_duration = (len(audio_buffer) - seg_index) / self.sample_rate # is_end = any(i in seg.text for i in config.SENTENCE_END_MARKERS) right_watch_sequences = segments[min(idx+1, len(segments)):] if rest_buffer_duration >= 1.5: if rest_buffer_duration >= 1: left_watch_idx = seg_index break return left_watch_idx, left_watch_sequences, right_watch_sequences, is_end27 unmodified lines continue
audio_buffer = self.get_audio_chunk_for_processing() logger.info(f"Processing audio with duration: {len(audio_buffer)}") # segments = self.transcribe_audio(audio_buffer) # c+= 1 # name = f"dev-{c}.wav" # save_to_wave(name, audio_buffer)33 unmodified lines context=message, from_=self.language, to=self.dst_lang, tran_content="this is english sample", tran_content=self.translate_text(message), partial=False ) if self._segment_manager.string.strip():3 unmodified lines context=self._segment_manager.string, from_=self.language, to=self.dst_lang, tran_content="this is english sample", tran_content=self.translate_text(self._segment_manager.string.stri()), ) else:5 unmodified lines context=message, from_=self.language, to=self.dst_lang, tran_content="this is english sample", tran_content=self.translate_text(message), ) def send_to_client(self, data:TransResult):transcribe/whisper_llm_serve.py+16-13