Translation
PEFT
Safetensors
File size: 2,941 Bytes
d95606d
e72ef39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d95606d
 
e72ef39
d95606d
 
 
e72ef39
d95606d
e72ef39
 
 
 
 
d95606d
e72ef39
d95606d
e72ef39
 
d95606d
 
 
 
 
 
 
 
 
 
e72ef39
 
 
 
d95606d
e72ef39
d95606d
e72ef39
 
 
d95606d
e72ef39
d95606d
e72ef39
 
d95606d
e72ef39
d95606d
e72ef39
d95606d
e72ef39
d95606d
e72ef39
 
d95606d
 
e72ef39
d95606d
e72ef39
d95606d
e72ef39
d95606d
e72ef39
 
 
d95606d
 
e72ef39
d95606d
e72ef39
 
 
 
 
 
 
 
 
 
d95606d
 
e72ef39
d95606d
e72ef39
d95606d
e72ef39
d95606d
e72ef39
d95606d
 
e72ef39
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
library_name: peft
license: cc-by-4.0
datasets:
- SPRINGLab/shiksha
- SPRINGLab/BPCC_cleaned
language:
- bn
- gu
- hi
- mr
- ml
- kn
- ta
- te
- en
metrics:
- bleu
base_model:
- facebook/nllb-200-3.3B
pipeline_tag: translation
---

# Shiksha MT Model Card

## Model Details

### 1. Model Description

- **Developed by:** [SPRING Lab](https://asr.iitm.ac.in)
- **Model type:** LoRA Adaptor
- **Language(s) (NLP):** Bengali, Gujarati, Hindi, Marathi, Malayalam, Kannada, Tamil, Telugu
- **License:** CC-BY-4.0
- **Finetuned from model:** [NLLB-200 3.3B](https://huggingface.co/facebook/nllb-200-3.3B)

### 2. Model Sources

- **Paper:** https://arxiv.org/abs/2412.09025
- **Demo:** https://asr.iitm.ac.in/demo/ttt

## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->


## How to Get Started with the Model

Use the code below to get started with the model.

```python
import torch
from peft import AutoPeftModelForSeq2SeqLM
from transformers import NllbTokenizerFast

device = "cuda" if torch.cuda.is_available() else "cpu"

# Load model and tokenizer from local checkpoint
model = AutoPeftModelForSeq2SeqLM.from_pretrained("SPRINGLab/shiksha-MT-nllb-3.3B", device_map=device)
tokenizer = NllbTokenizerFast.from_pretrained("facebook/nllb-200-3.3B")

input_text = "Welcome back to the lecture series in Cell Culture."

# Lang codes: https://github.com/facebookresearch/flores/tree/main/flores200
tgt_lang = "hin_Deva"

inputs = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)

output = model.generate(input_ids=inputs["input_ids"].to(device), max_new_tokens=256, forced_bos_token_id=tokenizer.convert_tokens_to_ids(tgt_lang))

output_text = tokenizer.batch_decode(output, skip_special_tokens=True)

print(output_text[0])
```


## Training Details

### 1. Training Data

We used the following datasets for training this adapter:

Shiksha: https://huggingface.co/datasets/SPRINGLab/shiksha
<br>
BPCC-cleaned: https://huggingface.co/datasets/SPRINGLab/BPCC_cleaned


#### 2. Training Hyperparameters

- peft-type: LORA
- rank: 256
- lora alpha: 256
- lora dropout: 0.1
- rslora: True
- target modules: all-linear
- learning rate: 4e-5
- optimizer: adafactor
- data-type: BF-16
- epochs: 1


### 3. Compute Infrastructure

We used 8 x A100 40GB GPUs for training this adapter. We would like to thank [CDAC](https://cdac.in) for providing the compute resources.

## Citation

If you use this model in your work, please cite us:

**BibTeX:**
```bibtex
@misc{joglekar2024shikshatechnicaldomainfocused,
      title={Shiksha: A Technical Domain focused Translation Dataset and Model for Indian Languages}, 
      author={Advait Joglekar and Srinivasan Umesh},
      year={2024},
      eprint={2412.09025},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.09025}, 
}
```