Views
No views yet
wmt24pp dataset, language support has been extended to 55 languages, primarily enhancing translation capabilities from English (en) to other target languages (xx).| 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 |
| Model | FLORES-200 | |
|---|---|---|
| xx → en | xx → zh | |
| WiNGPT-Babel-AWQ | 33.91 | 17.29 |
| WiNGPT-Babel-2-AWQ | 36.43 | 24.45 |
vllm. The following provides a basic usage example using the Hugging Face transformers library.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.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "winninghealth/WiNGPT-Babel-2"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12# Example: Translation of text within a JSON object to Chinese
13prompt_json = """{
14 "product_name": "High-Performance Laptop",
15 "features": ["Fast Processor", "Long Battery Life", "Lightweight Design"]
16}"""
17
18messages = [
19 {"role": "system", "content": "Translate this to Simplified Chinese Language"},
20 {"role": "user", "content": prompt_json} # Replace with the desired prompt
21]
22
23text = tokenizer.apply_chat_template(
24 messages,
25 tokenize=False,
26 add_generation_prompt=True
27)
28model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
29
30generated_ids = model.generate(
31 **model_inputs,
32 max_new_tokens=4096,
33 temperature=0
34)
35
36generated_ids = [
37 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
38]
39
40response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]