Translation
Transformers
PyTorch
IndicTrans
text2text-generation
indictrans2
ai4bharat
multilingual
custom_code
Instructions to use Raghavan/indictrans2-en-indic-dist-200M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Raghavan/indictrans2-en-indic-dist-200M 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="Raghavan/indictrans2-en-indic-dist-200M", trust_remote_code=True)# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("Raghavan/indictrans2-en-indic-dist-200M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload 7 files
Browse files- modeling_indictrans.py +0 -5
modeling_indictrans.py
CHANGED
|
@@ -825,11 +825,6 @@ class IndicTransDecoder(IndicTransPreTrainedModel):
|
|
| 825 |
def set_input_embeddings(self, value):
|
| 826 |
self.embed_tokens = value
|
| 827 |
|
| 828 |
-
def get_output_embeddings(self):
|
| 829 |
-
return self.lm_head
|
| 830 |
-
|
| 831 |
-
def set_output_embeddings(self, new_embeddings):
|
| 832 |
-
self.lm_head = new_embeddings
|
| 833 |
|
| 834 |
def forward(
|
| 835 |
self,
|
|
|
|
| 825 |
def set_input_embeddings(self, value):
|
| 826 |
self.embed_tokens = value
|
| 827 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 828 |
|
| 829 |
def forward(
|
| 830 |
self,
|