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 Settings
- 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
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
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
david commited on
Commit ·
b6e4de3
1
Parent(s): e1e0093
debug cut index
Browse files- transcribe/strategy.py +10 -5
transcribe/strategy.py
CHANGED
|
@@ -48,7 +48,7 @@ class TranscriptToken:
|
|
| 48 |
return PAUSEE_END_PATTERN.search(self.text) is not None
|
| 49 |
|
| 50 |
def buffer_index(self) -> int:
|
| 51 |
-
return int(self.t1 / 100 * SAMPLE_RATE)
|
| 52 |
|
| 53 |
@dataclass
|
| 54 |
class TranscriptChunk:
|
|
@@ -108,6 +108,9 @@ class TranscriptChunk:
|
|
| 108 |
return any(seg.is_punctuation() for seg in self.items)
|
| 109 |
|
| 110 |
def get_buffer_index(self) -> int:
|
|
|
|
|
|
|
|
|
|
| 111 |
return self.items[-1].buffer_index()
|
| 112 |
|
| 113 |
def is_end_sentence(self) ->bool:
|
|
@@ -182,10 +185,13 @@ class TranscriptBuffer:
|
|
| 182 |
self.update_pending_text(stable_string)
|
| 183 |
if is_end_sentence:
|
| 184 |
self.commit_paragraph(end_of_sentence=True)
|
|
|
|
| 185 |
# if len() >=20
|
|
|
|
| 186 |
else:
|
| 187 |
self.commit_line()
|
| 188 |
-
|
|
|
|
| 189 |
|
| 190 |
|
| 191 |
@property
|
|
@@ -278,11 +284,10 @@ class TranscriptStabilityAnalyzer:
|
|
| 278 |
logger.debug(f"Current cut index: {frame_cut_index}, Stable string: {stable_str}, Remaining_str:{remaining_str}")
|
| 279 |
|
| 280 |
prev_seg_id = self._transcript_buffer.get_seg_id()
|
| 281 |
-
self._transcript_buffer.update_and_commit(stable_str, remaining_str, is_end_sentence)
|
| 282 |
-
|
| 283 |
logger.debug(f"current buffer: {self._transcript_buffer.__dict__}")
|
| 284 |
|
| 285 |
-
if
|
| 286 |
# 表示生成了一个新段落 换行
|
| 287 |
yield TranscriptResult(
|
| 288 |
seg_id=prev_seg_id,
|
|
|
|
| 48 |
return PAUSEE_END_PATTERN.search(self.text) is not None
|
| 49 |
|
| 50 |
def buffer_index(self) -> int:
|
| 51 |
+
return max(int(self.t1 / 100 * SAMPLE_RATE) - 300, 0)
|
| 52 |
|
| 53 |
@dataclass
|
| 54 |
class TranscriptChunk:
|
|
|
|
| 108 |
return any(seg.is_punctuation() for seg in self.items)
|
| 109 |
|
| 110 |
def get_buffer_index(self) -> int:
|
| 111 |
+
logger.debug("==== Current cut item ====")
|
| 112 |
+
logger.debug(f"{self.items[-1]}")
|
| 113 |
+
logger.debug("==========================")
|
| 114 |
return self.items[-1].buffer_index()
|
| 115 |
|
| 116 |
def is_end_sentence(self) ->bool:
|
|
|
|
| 185 |
self.update_pending_text(stable_string)
|
| 186 |
if is_end_sentence:
|
| 187 |
self.commit_paragraph(end_of_sentence=True)
|
| 188 |
+
self.update_pending_text(remaining_string)
|
| 189 |
# if len() >=20
|
| 190 |
+
return True
|
| 191 |
else:
|
| 192 |
self.commit_line()
|
| 193 |
+
self.update_pending_text(remaining_string)
|
| 194 |
+
return False
|
| 195 |
|
| 196 |
|
| 197 |
@property
|
|
|
|
| 284 |
logger.debug(f"Current cut index: {frame_cut_index}, Stable string: {stable_str}, Remaining_str:{remaining_str}")
|
| 285 |
|
| 286 |
prev_seg_id = self._transcript_buffer.get_seg_id()
|
| 287 |
+
commit_paragraph = self._transcript_buffer.update_and_commit(stable_str, remaining_str, is_end_sentence)
|
|
|
|
| 288 |
logger.debug(f"current buffer: {self._transcript_buffer.__dict__}")
|
| 289 |
|
| 290 |
+
if commit_paragraph:
|
| 291 |
# 表示生成了一个新段落 换行
|
| 292 |
yield TranscriptResult(
|
| 293 |
seg_id=prev_seg_id,
|