From 60d8e1fb40094ca4af36249cdd0502418ac15ae4 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Mon, 20 Apr 2026 14:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: winninghealth/WiNGPT-Babel-2-GGUF Source: Original Platform --- .gitattributes | 38 +++++++ README.md | 216 +++++++++++++++++++++++++++++++++++++ WiNGPT-Babel-2-IQ4_XS.gguf | 3 + WiNGPT-Babel-2-Q4_K_M.gguf | 3 + WiNGPT-Babel-2-Q8_0.gguf | 3 + WiNGPT-Babel-2.jinja | 1 + 6 files changed, 264 insertions(+) create mode 100644 .gitattributes create mode 100644 README.md create mode 100644 WiNGPT-Babel-2-IQ4_XS.gguf create mode 100644 WiNGPT-Babel-2-Q4_K_M.gguf create mode 100644 WiNGPT-Babel-2-Q8_0.gguf create mode 100644 WiNGPT-Babel-2.jinja diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7f407bd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +WiNGPT-Babel-2-IQ4_XS.gguf filter=lfs diff=lfs merge=lfs -text +WiNGPT-Babel-2-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text +WiNGPT-Babel-2-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000..0ada2f2 --- /dev/null +++ b/README.md @@ -0,0 +1,216 @@ +--- +license: apache-2.0 +language: +- ar +- bg +- bn +- ca +- cs +- da +- de +- el +- es +- et +- fa +- fi +- fil +- fr +- gu +- he +- hi +- hr +- hu +- id +- is +- it +- ja +- kn +- ko +- lt +- lv +- ml +- mr +- nl +- 'no' +- pa +- pl +- pt +- ro +- ru +- sk +- sl +- sr +- sv +- sw +- ta +- te +- th +- tr +- uk +- ur +- vi +- zh +- zu +base_model: +- winninghealth/WiNGPT-Babel-2 +tags: +- GGUF +- multilingual +datasets: +- google/wmt24pp +pipeline_tag: translation +library_name: transformers +--- + +# WiNGPT-Babel-2: A Multilingual Translation Language Model + +[![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-WiNGPT--Babel-blue)](https://huggingface.co/collections/winninghealth/wingpt-babel-68463d4b2a28d0d675ff3be9) +[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-yellow.svg)](https://opensource.org/licenses/Apache-2.0) + +> This is the quantization version (llama.cpp) of [WiNGPT-Babel-2](https://huggingface.co/winninghealth/WiNGPT-Babel-2). +> +> Example +> +> ```shell +> ./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: + +1. **Expanded Language Support:** Through training with the `wmt24pp` dataset, language support has been extended to **55 languages**, primarily enhancing translation capabilities from English (en) to other target languages (xx). + +2. **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. + +3. **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. + +4. **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: + +1. **Data Collection:** Collecting anonymous, real-world translation task logs from integrated applications (e.g., Immersive Translate, Videolingo). +2. **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. +3. **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](https://huggingface.co/ModelSpace/GemmaX2-28-2B-Pretrain) +* **Primary Training Data:** "Human-in-the-loop" in-house dataset, [WMT24++](https://huggingface.co/datasets/google/wmt24pp) 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 + + + + + + + + + + + + + + + + + + + + + + + +
ModelFLORES-200
xx → enxx → zh
WiNGPT-Babel-AWQ33.9117.29
WiNGPT-Babel-2-AWQ36.4330.74
+ +**Note**: +1. The evaluation metric is spBLEU, using the FLORES-200 tokenizer. + +3. '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 + +```python +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](https://huggingface.co/winninghealth/WiNGPT-Babel#%F0%9F%8E%AC-%E7%A4%BA%E4%BE%8B). + +## LICENSE + + 1. This project's license agreement is the Apache License 2.0 + + 2. Please cite this project when using its model weights: https://huggingface.co/winninghealth/WiNGPT-Babel-2 + + 3. Comply with [gemma-2-2b](https://huggingface.co/google/gemma-2-2b), [GemmaX2-28-2B-v0.1](https://huggingface.co/ModelSpace/GemmaX2-28-2B-v0.1), [immersive-translate](https://github.com/immersive-translate/immersive-translate), [VideoLingo](https://github.com/immersive-translate/immersive-translate) 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 \ No newline at end of file diff --git a/WiNGPT-Babel-2-IQ4_XS.gguf b/WiNGPT-Babel-2-IQ4_XS.gguf new file mode 100644 index 0000000..0013602 --- /dev/null +++ b/WiNGPT-Babel-2-IQ4_XS.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ceeafcf74420ac65e8c0563ffb72bf226b6664ac57be3c5866e4f30c2352a96f +size 1566250368 diff --git a/WiNGPT-Babel-2-Q4_K_M.gguf b/WiNGPT-Babel-2-Q4_K_M.gguf new file mode 100644 index 0000000..31c57ef --- /dev/null +++ b/WiNGPT-Babel-2-Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7710255d05f855de0cbe19b6e13a58d7159b9d4ee81c4abce42436a78c743eab +size 1708582048 diff --git a/WiNGPT-Babel-2-Q8_0.gguf b/WiNGPT-Babel-2-Q8_0.gguf new file mode 100644 index 0000000..1f20d9a --- /dev/null +++ b/WiNGPT-Babel-2-Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9072d7f0e36296acd44437eea10d7115f935e90672229d92c788841d64e9e02 +size 2784494752 diff --git a/WiNGPT-Babel-2.jinja b/WiNGPT-Babel-2.jinja new file mode 100644 index 0000000..28220da --- /dev/null +++ b/WiNGPT-Babel-2.jinja @@ -0,0 +1 @@ +{% for message in messages %}{% if not loop.first %}{{- '\n' }}{% endif %}{{- '' + message['role'] + '\n' + message['content'] + '' }}{% if loop.last and add_generation_prompt %}{{- '\nassistant\n' }}{% endif %}{% endfor %} \ No newline at end of file