YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

English to Telugu Translation Model

This is a character-level Transformer model trained for English โ†’ Telugu translation.

Model Details

  • Architecture: Custom Transformer
  • Vocabulary: Character-level
  • Framework: PyTorch
  • Trained On: Parallel English-Telugu sentence pairs

Configuration

See config.json for detailed model architecture and vocabulary sizes.


Inference Code

import torch
import json
from model import Transformer  # make sure you have this definition

# Load config
with open("config.json", "r", encoding="utf-8") as f:
    config = json.load(f)

# Load vocab
with open("english_vocabulary.json", "r", encoding="utf-8") as f:
    en_vocab = json.load(f)
with open("telugu_vocabulary.json", "r", encoding="utf-8") as f:
    te_vocab = json.load(f)

# Reverse vocab for decoding
idx2telugu = {i: ch for i, ch in enumerate(te_vocab)}
telugu2idx = {ch: i for i, ch in enumerate(te_vocab)}

# Load model
model = Transformer(
    config["d_model"],
    config["ffn_hidden"],
    config["num_heads"],
    config["drop_prob"],
    config["num_layers"],
    len(en_vocab),
    len(te_vocab),
    config["max_sequence_length"]
)
model.load_state_dict(torch.load("pytorch_model.bin", map_location="cpu"))
model.eval()

# Translate a sentence
def translate(sentence):
    # Implement encoding โ†’ model inference โ†’ decoding
    pass  # Replace with your tokenization + inference code

print(translate("i love my country."))
Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support