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 lines11611711811912012111 unmodified lines13313413513613713813950 unmodified lines1901911921931941951961975 unmodified lines20320420520620720820921027 unmodified lines23823924024124224324430 unmodified lines2752762772782792802812822832842 unmodified lines28728828929029129229327 unmodified lines32132232332432532632732833 unmodified lines3623633643653663673683 unmodified lines3723733743753763773785 unmodified lines384385386387388389390115 unmodified lineswhisper_model = Nonellm_model = Nonevad_model = None@classmethoddef initializer(cls, event:mp.Event, warmup=True):11 unmodified lines# init llamacppcls.llm_model = QwenTranslator(config.LLM_MODEL_PATH, config.LLM_SYS_PROMPT)cls.vad_model = VoiceActivityDetector()event.set()@classmethoddef 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))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 linesself.trans_thread.start()def send_ready_state(self):while not self._ready_state:time.sleep(0.1)self.websocket.send(json.dumps({"uid": self.client_uid,27 unmodified lineselse:self.frames_np = np.append(self.frames_np,frame_np)def update_audio_buffer(self, last_offset):with self.lock:30 unmodified linesmarkers = config.PAUSE_END_MARKERSis_end = Falseelse:# 使用句号 问好等长句结尾符号作为判断markers = config.SENTENCE_END_MARKERSis_end = Truefor idx, seg in enumerate(segments):left_watch_sequences.append(seg)2 unmodified linesrest_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:left_watch_idx = seg_indexbreakreturn left_watch_idx, left_watch_sequences, right_watch_sequences, is_end27 unmodified linescontinueaudio_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 linescontext=message,from_=self.language,to=self.dst_lang,tran_content="this is english sample",partial=False)if self._segment_manager.string.strip():3 unmodified linescontext=self._segment_manager.string,from_=self.language,to=self.dst_lang,tran_content="this is english sample",)else:5 unmodified linescontext=message,from_=self.language,to=self.dst_lang,tran_content="this is english sample",)def send_to_client(self, data:TransResult):115 unmodified lines11611711811912012112211 unmodified lines13413513613713813914014114214314414514614750 unmodified lines1981992002012022032042055 unmodified lines21121221321421521621727 unmodified lines24524624724824925030 unmodified lines2812822832842852862872882892 unmodified lines29229329429529629729827 unmodified lines32632732832933033133 unmodified lines3653663673683693703713 unmodified lines3753763773783793803815 unmodified lines387388389390391392393115 unmodified lineswhisper_model = Nonellm_model = Nonevad_model = Noneinit_event = None@classmethoddef initializer(cls, event:mp.Event, warmup=True):11 unmodified lines# init llamacppcls.llm_model = QwenTranslator(config.LLM_MODEL_PATH, config.LLM_SYS_PROMPT)cls.vad_model = VoiceActivityDetector()cls.init_event = eventevent.set()@classmethoddef init(cls):pass@classmethoddef warmup(cls, warmup_steps=1):50 unmodified lines# 进程初始化后再开始收音频self._ready_state = mp.Event()self._pool = PPool(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 linesself.trans_thread.start()def send_ready_state(self):self._ready_state.wait()self.websocket.send(json.dumps({"uid": self.client_uid,27 unmodified lineselse:self.frames_np = np.append(self.frames_np,frame_np)def update_audio_buffer(self, last_offset):with self.lock:30 unmodified linesmarkers = config.PAUSE_END_MARKERSis_end = Falseelse:# 使用句号 长句结尾符号作为判断markers = config.SENTENCE_END_MARKERSis_end = Truefor idx, seg in enumerate(segments):left_watch_sequences.append(seg)2 unmodified linesrest_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:left_watch_idx = seg_indexbreakreturn left_watch_idx, left_watch_sequences, right_watch_sequences, is_end27 unmodified linescontinueaudio_buffer = self.get_audio_chunk_for_processing()# c+= 1# name = f"dev-{c}.wav"# save_to_wave(name, audio_buffer)33 unmodified linescontext=message,from_=self.language,to=self.dst_lang,tran_content=self.translate_text(message),partial=False)if self._segment_manager.string.strip():3 unmodified linescontext=self._segment_manager.string,from_=self.language,to=self.dst_lang,tran_content=self.translate_text(self._segment_manager.string.stri()),)else:5 unmodified linescontext=message,from_=self.language,to=self.dst_lang,tran_content=self.translate_text(message),)def send_to_client(self, data:TransResult):
transcribe/whisper_llm_serve.py+16-13