Instructions to use build-small-hackathon/ryugaku-jaen-translator-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use build-small-hackathon/ryugaku-jaen-translator-4b 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="build-small-hackathon/ryugaku-jaen-translator-4b")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("build-small-hackathon/ryugaku-jaen-translator-4b") model = AutoModelForMultimodalLM.from_pretrained("build-small-hackathon/ryugaku-jaen-translator-4b") - Notebooks
- Google Colab
- Kaggle
Ryugaku Japanese→English Translator 4B
A small, fine-tuned Qwen3.5-4B model for high-quality Japanese to English translation, built for international students studying in Japan.
Model description
- Base model: Qwen/Qwen3.5-4B
- Task: Japanese → English translation
- Fine-tuning method: LoRA (r=32, alpha=64) merged into a 16-bit model
- Training framework: Unsloth + TRL
- Model size: ~4B parameters
- License: Apache 2.0
Training data
The model was fine-tuned on a mix of:
- WikiMatrix Japanese-English parallel corpus
- Synthetic Japanese-English science/textbook sentence pairs
Total effective training samples: ~6,000 sentence pairs.
Intended use
- Translate Japanese lecture transcripts, textbooks, and everyday text into English
- Power the Ryugaku Gradio app submitted to the Backyard AI hackathon
- Run fully offline on consumer GPUs (≤16 GB VRAM)
How to use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "build-small-hackathon/ryugaku-jaen-translator-4b"
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "system", "content": "You are a precise Japanese-to-English translator. Translate the user's Japanese text into natural English only. Do not add explanations."},
{"role": "user", "content": "私は留学生です。"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Example
original
相転移にともなう潜熱の出入りは、系全体の自由エネルギーの極値条件に拘束されるため、単純な温度勾配のみに起因するフーリエの熱伝導則をそのまま適用すると、相境界における不連続な熱流束の跳ね返りを記述しきれず、結果として移動境界問題としてのステファン条件の定式化において、特異点近傍での数値的な発散や物理的な矛盾を引き起こす原因となる。
This Model
Because the latent heat associated with a phase transition is constrained by the extremum condition of the total free energy of the system, directly applying Fourier's law of heat conduction to a simple temperature gradient fails to capture the discontinuous heat flux jump at the phase interface. As a result, in formulating the Stefan condition as a moving boundary problem, this leads to numerical divergence near the singularity and unphysical contradictions.
Since the flow of latent heat associated with phase transitions is constrained by the conditions for the extremum of the system’s total free energy, a direct application of Fourier’s law of heat conduction—which is based solely on a simple temperature gradient—fails to adequately describe the discontinuous reflection of heat flux at phase boundaries. Consequently, this leads to numerical divergences and physical inconsistencies near singularities when formulating the Stefan condition as a moving-boundary problem.
DeepL
Since the inflow and outflow of latent heat associated with a phase transition is constrained by the extremum conditions of the free energy of the entire system, applying Fourier's law of heat conduction, which is based solely on a simple temperature gradient, fails to adequately describe the discontinuous rebound of heat flux at the phase boundary. As a result, this leads to numerical divergences and physical inconsistencies near the singularity in the formulation of the Stefan condition as a moving boundary problem.
Limitations
- Optimized for Japanese → English; English → Japanese quality is not guaranteed.
- May struggle with very long inputs or highly domain-specific terminology not present in training data.
Acknowledgments
- Downloads last month
- 15