Downloads · 30 days
25
20% of all-time downloads
tohoku-nlp/RFMT
RFMT is a translation model from tohoku-nlp. Use it when you need text moved from one language to another. The card lists the license as apache-2.0.
This is Team RFMT's submission system for the WMT2026 constrained (open-weight) track of the General Machine Translation Task. It supports English-Japanese and Chinese-Japanese translation. In addition to standard tra…
Downloads · 30 days
25
20% of all-time downloads
All-time downloads
124
Public
Parameters
14.8B
29.5 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors29.5 GB · 100%
From the Hugging Face model README
This is Team RFMT's submission system for the WMT2026 constrained (open-weight) track of the General Machine Translation Task. It supports English->Japanese and Chinese->Japanese translation. In addition to standard translation, it supports:
Verified to work with version 5.5.4.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "tohoku-nlp/RFMT"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto"
)
text = "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
message = [
{"role": "user", "content": text}
]
glossary = [
{"source": "quiet morning", "target": "静寂な朝"},
{"source": "ordinary day", "target": "凡庸な日"},
]
inputs = tokenizer.apply_chat_template(
message,
add_generation_prompt=True,
return_tensors="pt",
return_dict=True,
domain="News",
style="だ・である調",
glossary=glossary,
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(
tokenizer.decode(
outputs[0][inputs["input_ids"].shape[-1]:],
skip_special_tokens=True
)
)
Verified to work with version 0.19.1.
vllm serve tohoku-nlp/RFMT \
--gpu-memory-utilization 0.95 \
--dtype bfloat16 \
--seed 42
PORT=8000
# General translation
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: general_translation_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
}
],
"max_tokens": 512,
"temperature": 0.0
}' | jq
# FIM Translation
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: fim_translation_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. <|fim_prefix|>I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. <|fim_suffix|>By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
},
{
"role": "assistant",
"content": "今日はシンプルだけど温かい一日で、静かな朝と、私を笑顔にしてくれる小さな瞬間がいくつかありました。<|fim_middle|>夕方になると、普通の日でも注意深く見ると優しい思い出になることに気づきました。"
}
],
"max_tokens": 512,
"temperature": 0.0,
"chat_template_kwargs": {"add_fim_generation_prompt": true}
}' | jq
# Context-Aware Incremental Translation
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: prefix_forcing_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
}
],
"max_tokens": 512,
"temperature": 0.0,
"chat_template_kwargs": {"generation_prefix": "今日はとりとめもなく暖かい"}
}' | jq
# Domain prompting
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: domain_specification_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
}
],
"max_tokens": 512,
"temperature": 0.0,
"chat_template_kwargs": {"domain": "News"}
}' | jq
# Style prompting
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: style_specification_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
}
],
"max_tokens": 512,
"temperature": 0.0,
"chat_template_kwargs": {"style": "だ・である調"}
}' | jq
# Glossary prompting
curl http://localhost:$PORT/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-Request-Id: glossary_specification_example" \
-d '{
"model": "tohoku-nlp/RFMT",
"messages": [
{
"role": "user",
"content": "Today felt simple but warm, with a quiet morning and a few small moments that made me smile. I took a walk, noticed the soft light in the sky, and felt grateful for the peaceful rhythm of the day. By evening, I realized that even an ordinary day can become a gentle memory when I pay attention to it."
}
],
"max_tokens": 512,
"temperature": 0.0,
"chat_template_kwargs": {"glossary": [{"source": "quiet morning", "target": "静寂な朝"}, {"source": "ordinary day", "target": "凡庸な日"}]}
}' | jq
While the authors of this model/dataset have exercised utmost care regarding its contents, functionality, and other aspects during its creation, they make no guarantees as to the accuracy or safety of the model's outputs and assume no responsibility whatsoever.
In the unlikely event that any inconvenience or damage occurs to the user as a result of using this model/dataset, neither the authors of the model or dataset nor the organizations to which the authors belong shall bear any responsibility.
This model and dataset are distributed under the Apache License 2.0.
We would like to thank everyone at the Tohoku NLP Group for their cooperation in various aspects of building this model. We would also like to express our gratitude to everyone who organized the WMT General MT Task.
Work in progress. We are currently writing a system description paper.