Downloads · 30 days
0
0% of all-time downloads
DipeshY/eng_to_hin_torch
eng_to_hin_torch is a translation model from DipeshY. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as apache-2.0.
This model has been pushed to the Hub using the PytorchModelHubMixin integration: - The pytorch transformer model is for translating English to Hindi - Model trained using Samanantar v3 dataset
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
17
Public
Repo size
30 MB
Likes
0
Public
Click a slice to open those files.
.safetensors30 MB · 100%
From the Hugging Face model README
This model has been pushed to the Hub using the PytorchModelHubMixin integration:
import json
import torch
from scripts.transformer import Transformer
from scripts.inference_helper import translate
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Read index to hindi vocab mapping
with open("./config/index_to_hindi.json", "r") as f:
index_to_hindi = json.load(f)
index_to_hindi = {int(k): v for k, v in index_to_hindi.items()}
# Load model
model = Transformer.from_pretrained("./eng_to_hin_model/")
model.eval()
model.to(device)
# Generate translation
eng_sentence = "hello how are you doing"
translation = translate(eng_sentence, model, index_to_hindi)
print(translation)