Instructions to use MiaoMint/WiNGPT-Babel-2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiaoMint/WiNGPT-Babel-2-GGUF with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="MiaoMint/WiNGPT-Babel-2-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MiaoMint/WiNGPT-Babel-2-GGUF", dtype="auto") - llama-cpp-python
How to use MiaoMint/WiNGPT-Babel-2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="MiaoMint/WiNGPT-Babel-2-GGUF", filename="WiNGPT-Babel-2-IQ4_XS.gguf", )
llm.create_chat_completion( messages = "\"ะะตะฝั ะทะพะฒัั ะะพะปััะณะฐะฝะณ ะธ ั ะถะธะฒั ะฒ ะะตัะปะธะฝะต\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use MiaoMint/WiNGPT-Babel-2-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
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 MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
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 MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use MiaoMint/WiNGPT-Babel-2-GGUF with Ollama:
ollama run hf.co/MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
- Unsloth Studio new
How to use MiaoMint/WiNGPT-Babel-2-GGUF 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 MiaoMint/WiNGPT-Babel-2-GGUF 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 MiaoMint/WiNGPT-Babel-2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for MiaoMint/WiNGPT-Babel-2-GGUF to start chatting
- Docker Model Runner
How to use MiaoMint/WiNGPT-Babel-2-GGUF with Docker Model Runner:
docker model run hf.co/MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
- Lemonade
How to use MiaoMint/WiNGPT-Babel-2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MiaoMint/WiNGPT-Babel-2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.WiNGPT-Babel-2-GGUF-Q4_K_M
List all available models
lemonade list
WiNGPT-Babel-2: A Multilingual Translation Language Model
This is the quantization version (llama.cpp) of WiNGPT-Babel-2.
Example
./llama-server -m WiNGPT-Babel-2-GGUF/WiNGPT-Babel-2-IQ4_XS.gguf --jinja --chat-template-file WiNGPT-Babel-2-GGUF/WiNGPT-Babel-2.jinja
- --jinja: This flag activates the Jinja2 chat template processor.
- --chat-template-file: This flag points the server to the required template file that defines the WiNGPT-Babel-2's custom prompt format.
WiNGPT-Babel-2 is a language model optimized for multilingual translation tasks. As an iteration of WiNGPT-Babel, it features significant improvements in language coverage, data format handling, and translation accuracy for complex content.
The model continues the "Human-in-the-loop" training strategy, iteratively optimizing through the analysis of log data from real-world application scenarios to ensure its effectiveness and reliability in practical use.
Core Improvements in Version 2.0
WiNGPT-Babel-2 introduces the following key technical upgrades over its predecessor:
Expanded Language Support: Through training with the
wmt24ppdataset, language support has been extended to 55 languages, primarily enhancing translation capabilities from English (en) to other target languages (xx).Enhanced Chinese Translation: The translation pipeline from other source languages to Chinese (xx โ zh) has been specifically optimized, improving the accuracy and fluency of the results.
Structured Data Translation: The model can now identify and translate text fields embedded within structured data (e.g., JSON) while preserving the original data structure. This feature is suitable for scenarios such as API internationalization and multilingual dataset preprocessing.
Mixed-Content Handling: Its ability to handle mixed-content text has been improved, enabling more accurate translation of paragraphs containing mathematical expressions (LaTeX), code snippets, and web markup (HTML/Markdown), while preserving the format and integrity of these non-translatable elements.
Training Methodology
The performance improvements in WiNGPT-Babel-2 are attributed to a continuous, data-driven, iterative training process:
- Data Collection: Collecting anonymous, real-world translation task logs from integrated applications (e.g., Immersive Translate, Videolingo).
- Data Refinement: Using a reward model for rejection sampling on the collected data, supplemented by manual review, to filter high-quality, high-value samples for constructing new training datasets.
- Iterative Retraining: Using the refined data for the model's incremental training, continuously improving its performance in specific domains and scenarios through a cyclical iterative process.
Technical Specifications
- Base Model: GemmaX2-28-2B-Pretrain
- Primary Training Data: "Human-in-the-loop" in-house dataset, WMT24++ dataset
- Maximum Context Length: 4096 tokens
- Chat Capability: Supports multi-turn dialogue, allowing for contextual follow-up and translation refinement.
Language Support
| Direction | Description | Supported Languages (Partial List) |
|---|---|---|
| Core Support | Highest quality, extensively optimized. | en โ zh |
| Expanded Support | Supported via wmt24pp dataset training. |
en โ 55+ languages, including: fr, de, es, ru, ar, pt, ko, it, nl, tr, pl, sv... |
| Enhanced to Chinese | Specifically optimized for translation into Chinese. | xx โ zh |
Performance
| Model | FLORES-200 | |
|---|---|---|
| xx โ en | xx โ zh | |
| WiNGPT-Babel-AWQ | 33.91 | 17.29 |
| WiNGPT-Babel-2-AWQ | 36.43 | 30.74 |
Note:
The evaluation metric is spBLEU, using the FLORES-200 tokenizer.
'xx' represents the 52 source languages from the wmt24pp dataset.
Usage Guide
For optimal inference performance, it is recommended to use frameworks such as vllm. The following provides a basic usage example using the Hugging Face transformers library.
System Prompt: For optimal automatic language inference, it is recommended to use the unified system prompt: Translate this to {{to}} Language. Replace {{to}} with the name of the target language. For instance, use Translate this to Simplified Chinese Language to translate into Chinese, or Translate this to English Language to translate into English. This method provides precise control over the translation direction and yields the most reliable results.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "winninghealth/WiNGPT-Babel-2-AWQ"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Example: Translation of text within a JSON object to Chinese
prompt_json = """{
"product_name": "High-Performance Laptop",
"features": ["Fast Processor", "Long Battery Life", "Lightweight Design"]
}"""
messages = [
{"role": "system", "content": "Translate this to Simplified Chinese Language"},
{"role": "user", "content": prompt_json} # Replace with the desired prompt
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=4096,
temperature=0
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
For additional usage demos, you can refer to the original WiNGPT-Babel.
LICENSE
This project's license agreement is the Apache License 2.0
Please cite this project when using its model weights: https://huggingface.co/winninghealth/WiNGPT-Babel-2
Comply with gemma-2-2b, GemmaX2-28-2B-v0.1, immersive-translate, VideoLingo protocols and licenses, details on their website.
Contact Us
- Apply for a token through the WiNGPT platform
- Or contact us at wair@winning.com.cn to request a free trial API_KEY
- Downloads last month
- 125
4-bit
8-bit
Model tree for MiaoMint/WiNGPT-Babel-2-GGUF
Base model
google/gemma-2-2b