Instructions to use ZygAI/ZygAI-OSS-Translate-Lithuanian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZygAI/ZygAI-OSS-Translate-Lithuanian 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="ZygAI/ZygAI-OSS-Translate-Lithuanian")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ZygAI/ZygAI-OSS-Translate-Lithuanian", dtype="auto") - PEFT
How to use ZygAI/ZygAI-OSS-Translate-Lithuanian with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
ZygAI OSS Translator — English → Lithuanian
ZygAI OSS Translate Lithuanian is a fine-tuned version of openbmb/MiniCPM5-1B, specialized for English to Lithuanian translation. It is part of the ZygAI open source initiative to bring AI tools to the Lithuanian language.
🇱🇹 First open-source Lithuanian translation model based on MiniCPM5 architecture.
Demo
Try it live: ZygAI Translate Lithuanian DEMO
Run Locally
# Clone repository
git clone https://huggingface.co/spaces/ZygAI/ZygAI-Translate-Lithuanian-DEMO
cd ZygAI-Translate-Lithuanian-DEMO
# Create and activate Python environment
python -m venv env
source env/bin/activate
# Install dependencies and run
pip install -r requirements.txt
python app.py
Quick Start
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
base_model = "openbmb/MiniCPM5-1B"
lora_model = "ZygAI/ZygAI-OSS-Translate-Lithuanian"
tokenizer = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, dtype=torch.float16)
model = PeftModel.from_pretrained(model, lora_model)
model.eval()
def translate(text):
prompt = f"### Instruction:\n{text}\n### Response:\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=128)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
return result.split("### Response:\n")[-1]
print(translate("Hello, how are you?"))
# → Labas pasaulis
print(translate("How are you?"))
# → O kaip jūs?
Training Details
| Parameter | Value |
|---|---|
| Base model | openbmb/MiniCPM5-1B |
| Dataset | Helsinki-NLP/opus-100 (en-lt) |
| Training samples | 50,000 |
| Method | SFT + LoRA (PEFT) |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| Epochs | 3 |
| Batch size | 4 |
| Max sequence length | 256 |
| Hardware | NVIDIA A100 SXM |
| Framework | TRL + Transformers |
Limitations
Translation quality is functional but not perfect — this is an open-source community model, not a production translation service. Future versions will include larger datasets, better evaluation metrics, and improved inference quality.
About ZygAI
ZygAI is a Lithuanian AI platform developed by ZygMediaGroup. This model is part of ZygAI's open source effort to develop Lithuanian language AI tools accessible to everyone.
License
Apache 2.0
Citation
@software{vonwerra2020trl,
title = {{TRL: Transformers Reinforcement Learning}},
author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
license = {Apache-2.0},
url = {https://github.com/huggingface/trl},
year = {2020}
}
Model tree for ZygAI/ZygAI-OSS-Translate-Lithuanian
Base model
openbmb/MiniCPM5-1B