File size: 801 Bytes
ca230c6
 
 
a28bd28
 
 
 
 
 
 
 
 
 
 
7a0a7a5
a28bd28
 
 
2d3a4dc
a28bd28
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
license: cc0-1.0
---
A model that translates English sentences to Hindi.

To use this model, use the following code:

```python
from transformers import AutoTokenizer, TFAutoModelForSeq2SeqLM
model_checkpoint = "aryaumesh/tf_model"

tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
model = TFAutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)

text  = "This is a test case."
tokenized = tokenizer([text], return_tensors='np') # Convert input text to numerical format first
out = model.generate(**tokenized, max_length=128) # Performs translation

# Get translated text
with tokenizer.as_target_tokenizer():
    translated_text = tokenizer.decode(out[0], skip_special_tokens=True)
    print(translated_text) # यह एक परीक्षण का मामला है।
```