Run this model with HF Jobs
Run Devavrat28/Gemmarathi2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Devavrat28/Gemmarathi2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Devavrat28/Gemmarathi2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use Devavrat28/Gemmarathi2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Devavrat28/Gemmarathi2 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-2-9b-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Devavrat28/Gemmarathi2") - Notebooks
- Google Colab
- Kaggle
Model Card for Gemma2 7B - English to Marathi Translation
Model Details
Model Description
This model is a fine-tuned variant of Unsloth's Gemma2 7B, trained for high-quality English-to-Marathi translations. Built on a robust transformer architecture, the model handles complex translations, idiomatic expressions, and long-context paragraphs effectively. It is optimized for efficient inference using 4-bit quantization.
- Developed by: Devavrat Samak
- Model type: Causal Language Model, fine-tuned for translation tasks.
- Language(s) (NLP): English (en), Marathi (mr)
- License: Apache-2.0
- Finetuned from model: unsloth/gemma-2-9b-bnb-4bit
Model Sources
- Repository: [https://github.com/Devsam2898/Gemma2-Marathi]
Uses
Direct Use
The model can be directly used for English-to-Marathi translations, including handling long-context paragraphs, noisy inputs, and code-mixed sentences.
Downstream Use
The model can be integrated into applications for:
- Chatbots with multilingual support.
- Translating historical texts for research.
- Localization of content for Marathi-speaking audiences.
Out-of-Scope Use
- The model is not designed for real-time, high-speed translation in latency-critical systems.
- It may not generalize well for highly domain-specific jargon without additional fine-tuning.
Bias, Risks, and Limitations
- The model's translations might occasionally lose nuance or context in culturally significant expressions.
- Performance may degrade for noisy data or highly informal text.
Recommendations
- Users should validate translations in sensitive domains to ensure accuracy.
- Consider additional fine-tuning for domain-specific tasks.
How to Get Started with the Model
from transformers import AutoTokenizer
from unsloth import Gemma2
# Load model and tokenizer
model = Gemma2.from_pretrained("unsloth/gemma-2-9b-bnb-4bit")
tokenizer = AutoTokenizer.from_pretrained("unsloth/gemma-2-9b-bnb-4bit")
# Input and inference
input_text = "The golden age of the Peshwas brought cultural and political prosperity to Maharashtra."
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(inputs["input_ids"], max_length=128)
translated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(translated_text)
- Downloads last month
- 5
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-2-9b-bnb-4bit") model = PeftModel.from_pretrained(base_model, "Devavrat28/Gemmarathi2")