79 lines
3.1 KiB
Markdown
79 lines
3.1 KiB
Markdown
---
|
||
base_model: Qwen/Qwen3-4B-Instruct-2507
|
||
language:
|
||
- hi
|
||
- en
|
||
license: apache-2.0
|
||
library_name: transformers
|
||
pipeline_tag: text-generation
|
||
tags:
|
||
- qwen3
|
||
- hindi
|
||
- indic
|
||
- india
|
||
- instruction-tuned
|
||
- unsloth
|
||
- lora
|
||
- conversational
|
||
---
|
||
|
||
A Hindi instruction-tuned version of **Qwen3-4B**, fine-tuned to follow instructions and respond naturally in Hindi. Built for developers, researchers, and builders who need a capable, openly-licensed Hindi language model that runs on modest hardware.
|
||
|
||
Part of the **Hindi LLM Series** — a collection focused on bringing strong Indic-language models to local and edge deployment.
|
||
|
||
> 💡 Looking to run this locally on CPU? Use the **[GGUF version](https://huggingface.co/pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2-GGUF)** (Q4/Q5/Q8) with llama.cpp, Ollama, or LM Studio.
|
||
|
||
## Highlights
|
||
|
||
- **Strong Hindi instruction-following** — trained on 10K curated Hindi instruction–response pairs
|
||
- **Bilingual** — handles both Hindi (Devanagari) and English
|
||
- **Compact** — 4B parameters, runs comfortably on a single consumer GPU; quantizes well for CPU
|
||
- **Open license** — Apache 2.0, commercial use allowed
|
||
|
||
## Quick Start
|
||
|
||
```python
|
||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||
|
||
model_id = "pankajpandey-dev/Qwen3-4B-Hindi-Instruct-v2"
|
||
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
||
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
|
||
|
||
messages = [{"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, temperature=0.7)
|
||
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
||
```
|
||
|
||
## Model Details
|
||
|
||
| Property | Value |
|
||
|----------|-------|
|
||
| Base model | Qwen/Qwen3-4B-Instruct-2507 |
|
||
| Parameters | ~4B |
|
||
| Fine-tuning method | LoRA (r=32, α=32) via Unsloth |
|
||
| Training data | 10K Hindi instruction–response pairs |
|
||
| Languages | Hindi (hi), English (en) |
|
||
| Context length | inherited from base |
|
||
| License | Apache 2.0 |
|
||
|
||
## Training
|
||
|
||
Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) for efficient LoRA training. The dataset was filtered to keep only genuinely Hindi (Devanagari) responses, then formatted with the Qwen chat template and trained for one full epoch. The resulting LoRA was merged into 16-bit weights and exported.
|
||
|
||
## Intended Use & Limitations
|
||
|
||
**Intended for:** Hindi chat and assistant applications, instruction-following, Indic-language experimentation, and local/edge deployment via GGUF.
|
||
|
||
**Limitations:** As a 4B model, it can make factual errors and may produce inconsistent results on complex reasoning or specialized domains. It inherits any biases present in the base model and training data. Validate outputs before production use.
|
||
|
||
## Citation
|
||
|
||
If you use this model, a link back to this repository is appreciated.
|
||
|
||
---
|
||
|
||
*Part of the 🇮🇳 Hindi LLM Series by [pankajpandey-dev](https://huggingface.co/pankajpandey-dev).*
|