Views
No views yet
temperature, top_p, and top_k unless you intentionally want to test sampling behavior.| Parameter | Recommended value |
|---|---|
| sampling fields | omit |
| context length | 8192 |
max_tokens | 4096 |
| thinking | disabled, if runtime supports it |
max_tokens=2048 was used. For regular inference, use max_tokens=4096.You are a professional Lao-Thai translator. Translate completely and faithfully according to the user instruction. Do not summarize, omit, reorder, or add information. For names, places, organizations, projects, apps, and transliterated terms, consider source spelling first. Do not substitute a more familiar name, do not add syllables, and do not change a name into another entity. Preserve protected tokens from the source exactly, including all numbers, leading zeros, dates, times, amounts, percentages, document IDs, article/case numbers, phone numbers, IP addresses, versions, CVE/CWE IDs, hashes, URLs, emails, file names, product codes, separators such as - / . : _ ( ) [ ], names, tables, bullets, and Q&A labels. Before answering, silently check that every protected token from the source is still present in the translation. Return only the translation.1แปลภาษาลาวให้เป็นภาษาไทยแบบครบถ้วนตามต้นฉบับ
2ข้อกำหนด:
3- แปลทุกประโยคตามลำดับเดิม ห้ามสรุป ห้ามตัด ห้ามข้าม และห้ามเพิ่มข้อมูลใหม่
4- ให้พิจารณาตัวสะกดของต้นฉบับก่อนเลือกคำแปล โดยเฉพาะชื่อเฉพาะและคำทับศัพท์
5- ชื่อบุคคล ชื่อสถานที่ ชื่อหน่วยงาน ชื่อโครงการ ชื่อแอป และคำทับศัพท์ ให้ถอดเป็นภาษาไทยตามรูปสะกด/เสียงจากต้นฉบับหรือคำแปลอ้างอิงเท่านั้น
6- ห้ามเดาชื่อเฉพาะให้เป็นชื่อที่คุ้นเคยกว่า และห้ามเปลี่ยนเป็นชื่อสถานที่ ชื่อบุคคล หรือชื่อหน่วยงานอื่น
7- ห้ามเพิ่มพยางค์หรือคำที่ไม่มีในต้นฉบับลงในชื่อเฉพาะ
8- คัดลอก protected tokens ตามต้นฉบับให้ครบทุกตัวอักษร: เลขทุกชุด เลข 0 นำหน้า เลขฉบับ เลขมาตรา เลขคดี วันที่ เวลา จำนวนเงิน เปอร์เซ็นต์ เบอร์โทร IP เวอร์ชัน CVE/CWE URL อีเมล hash path ชื่อไฟล์ และรหัสสินค้า
9- ห้ามเปลี่ยนรูปเลขหรือรหัส ห้ามรวม/แยกเลขเอง และห้ามเปลี่ยนเครื่องหมายคั่นในรหัส เช่น -, /, ., :, _, (), []
10- คงรูปชื่อเฉพาะ ชื่อบุคคล ชื่อหน่วยงาน ชื่อผลิตภัณฑ์ คำอังกฤษ ตัวย่อ รหัส CVE เลข วันที่ เวลา จำนวนเงิน เปอร์เซ็นต์ URL อีเมล และข้อกฎหมายให้ตรงต้นฉบับหรือคำแปลอ้างอิง
11- คำกฎหมาย/ราชการ เช่น มาตรา พ.ร.บ. พ.ร.ก. ศาลฎีกา เพิกถอน ฝากขังผัดแรก และจำนวนกรรม ให้รักษาความหมายเดิม
12- ก่อนตอบให้ตรวจว่าเลข/รหัส/URL/อีเมล/ชื่ออังกฤษจากต้นฉบับยังอยู่ครบในคำแปล แต่ไม่ต้องแสดงขั้นตอนตรวจ
13- ตอบเฉพาะคำแปลภาษาไทยเท่านั้น
14
15### ภาษาลาว
16{source_text}
17
18### ภาษาไทย1huggingface-cli download thodsapon/qwen3.5-9b-MT-Lao-to-TH-GGUF-V1.5 \
2 lao_to_thai_final_adapter_Q4_K_M.gguf \
3 --local-dir .
4
5llama-server \
6 -m lao_to_thai_final_adapter_Q4_K_M.gguf \
7 -c 8192 \
8 -ngl 99 \
9 --host 127.0.0.1 \
10 --port 8080 \
11 --flash-attn on1import requests
2
3SYSTEM_PROMPT = """You are a professional Lao-Thai translator. Translate completely and faithfully according to the user instruction. Do not summarize, omit, reorder, or add information. For names, places, organizations, projects, apps, and transliterated terms, consider source spelling first. Do not substitute a more familiar name, do not add syllables, and do not change a name into another entity. Preserve protected tokens from the source exactly, including all numbers, leading zeros, dates, times, amounts, percentages, document IDs, article/case numbers, phone numbers, IP addresses, versions, CVE/CWE IDs, hashes, URLs, emails, file names, product codes, separators such as - / . : _ ( ) [ ], names, tables, bullets, and Q&A labels. Before answering, silently check that every protected token from the source is still present in the translation. Return only the translation."""
4
5def build_user_prompt(source_text: str) -> str:
6 return f"""แปลภาษาลาวให้เป็นภาษาไทยแบบครบถ้วนตามต้นฉบับ
7ข้อกำหนด:
8- แปลทุกประโยคตามลำดับเดิม ห้ามสรุป ห้ามตัด ห้ามข้าม และห้ามเพิ่มข้อมูลใหม่
9- ให้พิจารณาตัวสะกดของต้นฉบับก่อนเลือกคำแปล โดยเฉพาะชื่อเฉพาะและคำทับศัพท์
10- ชื่อบุคคล ชื่อสถานที่ ชื่อหน่วยงาน ชื่อโครงการ ชื่อแอป และคำทับศัพท์ ให้ถอดเป็นภาษาไทยตามรูปสะกด/เสียงจากต้นฉบับหรือคำแปลอ้างอิงเท่านั้น
11- ห้ามเดาชื่อเฉพาะให้เป็นชื่อที่คุ้นเคยกว่า และห้ามเปลี่ยนเป็นชื่อสถานที่ ชื่อบุคคล หรือชื่อหน่วยงานอื่น
12- ห้ามเพิ่มพยางค์หรือคำที่ไม่มีในต้นฉบับลงในชื่อเฉพาะ
13- คัดลอก protected tokens ตามต้นฉบับให้ครบทุกตัวอักษร: เลขทุกชุด เลข 0 นำหน้า เลขฉบับ เลขมาตรา เลขคดี วันที่ เวลา จำนวนเงิน เปอร์เซ็นต์ เบอร์โทร IP เวอร์ชัน CVE/CWE URL อีเมล hash path ชื่อไฟล์ และรหัสสินค้า
14- ห้ามเปลี่ยนรูปเลขหรือรหัส ห้ามรวม/แยกเลขเอง และห้ามเปลี่ยนเครื่องหมายคั่นในรหัส เช่น -, /, ., :, _, (), []
15- คงรูปชื่อเฉพาะ ชื่อบุคคล ชื่อหน่วยงาน ชื่อผลิตภัณฑ์ คำอังกฤษ ตัวย่อ รหัส CVE เลข วันที่ เวลา จำนวนเงิน เปอร์เซ็นต์ URL อีเมล และข้อกฎหมายให้ตรงต้นฉบับหรือคำแปลอ้างอิง
16- คำกฎหมาย/ราชการ เช่น มาตรา พ.ร.บ. พ.ร.ก. ศาลฎีกา เพิกถอน ฝากขังผัดแรก และจำนวนกรรม ให้รักษาความหมายเดิม
17- ก่อนตอบให้ตรวจว่าเลข/รหัส/URL/อีเมล/ชื่ออังกฤษจากต้นฉบับยังอยู่ครบในคำแปล แต่ไม่ต้องแสดงขั้นตอนตรวจ
18- ตอบเฉพาะคำแปลภาษาไทยเท่านั้น
19
20### ภาษาลาว
21{source_text}
22
23### ภาษาไทย
24"""
25
26source_text = "ສະບາຍດີ ຂ້ອຍຊື່ ສົມຊາຍ ແລະ ມີເລກອ້າງອີງ INV-2026/001."
27
28payload = {
29 "model": "lao-to-thai-q4",
30 "messages": [
31 {"role": "system", "content": SYSTEM_PROMPT},
32 {"role": "user", "content": build_user_prompt(source_text)},
33 ],
34 "max_tokens": 4096,
35 "stream": False,
36 "chat_template_kwargs": {"enable_thinking": False},
37}
38
39response = requests.post("http://127.0.0.1:8080/v1/chat/completions", json=payload, timeout=600)
40response.raise_for_status()
41print(response.json()["choices"][0]["message"]["content"].strip())| Item | Value |
|---|---|
| Epochs | 2 |
| LoRA rank | 32 |
| LoRA alpha | 32 |
| Scheduler | cosine |
| Max sequence length | 8192 |
| Epoch 2 final logged loss | 0.008393 at checkpoint-3008 / step 3008 |
lao_thai_use_cases.xlsx: Excel use-case file with exactly two columns: A ภาษาลาว, B ภาษาไทย.| Model | Cases (items) | BLEU (0-100) | chrF++ (0-100) | Exact (ratio) | Protected missing (tokens) | CJK chars (chars) | Avg sec (sec/case) |
|---|---|---|---|---|---|---|---|
| FT_Q8_0 | 30 | 93.2327 | 94.6946 | 0.0000 | 9 | 2 | 2.02 |
| FT_Q6_K | 30 | 92.9800 | 94.5062 | 0.0000 | 14 | 4 | 1.68 |
| FT_Q4_K_M | 30 | 89.9864 | 92.1602 | 0.0000 | 17 | 2 | 1.41 |
| Qwen3.6_35B_A3B_Q6_K_XL | 30 | 86.5539 | 90.1042 | 0.0000 | 40 | 0 | 1.34 |
| Qwen3.5_9B_Base_HF | 30 | 83.9285 | 89.2971 | 0.0000 | 7 | 0 | 6.57 |
| Qwen3.6_27B_MTB_Q6_K_XL | 30 | 81.9250 | 88.2279 | 0.0000 | 19 | 0 | 4.89 |
| Qwen3.5_4B_Base_HF | 30 | 78.6997 | 84.7728 | 0.0000 | 53 | 0 | 7.19 |
temperature, top_p, top_k); Hugging Face base-model tests used greedy generation with do_sample=False.Cases (items): EN: number of synthetic test examples. TH: จำนวนตัวอย่างทดสอบBLEU (0-100): EN: translation similarity score on a 0-100 scale; higher is better. TH: คะแนนความใกล้เคียงของคำแปลในสเกล 0-100 ยิ่งสูงยิ่งดีchrF++ (0-100): EN: character n-gram F-score with word-order support on a 0-100 scale; higher means the generated Thai text is closer to the reference. TH: คะแนนความใกล้เคียงระดับตัวอักษรพร้อมพิจารณาลำดับคำในสเกล 0-100 ยิ่งสูงยิ่งใกล้คำแปลอ้างอิงExact (ratio): EN: strict exact-match ratio after trimming leading/trailing whitespace. TH: สัดส่วนคำตอบที่ตรงกับคำแปลอ้างอิงทุกตัวอักษรหลังตัดช่องว่างหัวท้ายProtected missing (tokens): EN: count of protected source tokens missing from the output, such as numbers, dates, IDs, URLs, emails, product names, and codes. TH: จำนวน token สำคัญจากต้นฉบับที่หายไปจากผลลัพธ์ เช่น ตัวเลข วันที่ รหัส URL อีเมล ชื่อสินค้า และ codeCJK chars (chars): EN: count of Chinese/Japanese/Korean characters found in the generated output. TH: จำนวนอักขระจีน/ญี่ปุ่น/เกาหลีที่หลุดมาในผลลัพธ์Avg sec (sec/case): EN: average generation time in seconds per test example. TH: เวลาเฉลี่ยในการสร้างคำตอบ หน่วยเป็นวินาทีต่อหนึ่งตัวอย่าง