Downloads · 30 days
5
23% of all-time downloads
FabihaHaider/transliterated_nmt
transliterated_nmt is a machine learning model from FabihaHaider. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
libraryname: transformers tags: [] --- --
Downloads · 30 days
5
23% of all-time downloads
All-time downloads
22
Public
Parameters
248M
991 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
This repository contains the Banglanmt_bn_en model finetuned on the BanglaTLit dataset for the downstream task of Bangla to Transliterated Bangla.
<!-- ## Model Details --> <!-- ### Model Description --> <!-- Provide a longer summary of what this model is. --> <!-- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated. - **Developed by:** [More Information Needed] - **Funded by [optional]:** [More Information Needed] - **Shared by [optional]:** [More Information Needed] - **Model type:** [More Information Needed] - **Language(s) (NLP):** [More Information Needed] - **License:** [More Information Needed] - **Finetuned from model [optional]:** [More Information Needed] --> <!-- ### Model Sources [optional] --> <!-- Provide the basic links for the model. --> <!-- - **Repository:** [More Information Needed] - **Paper [optional]:** [More Information Needed] - **Demo [optional]:** [More Information Needed] -->from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
model_name = "FabihaHaider/transliterated_nmt"
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
torch_device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(torch_device)
print(torch_device)
def predict_output(input_sentence):
input_ids = tokenizer((input_sentence), return_tensors="pt").input_ids
generated_tokens = model.generate(input_ids)
decoded_tokens = tokenizer.batch_decode(generated_tokens)[0]
decoded_tokens = normalize(decoded_tokens)
return decoded_tokens
predict_output("আমি ভাত খাই প্রায় প্রতিদিন।")
<!-- ### Direct Use -->
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
<!-- [More Information Needed] -->
<!-- ### Downstream Use [optional] -->
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
<!-- [More Information Needed] -->
<!-- ### Out-of-Scope Use -->
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
<!-- [More Information Needed] -->
<!-- ## Bias, Risks, and Limitations -->
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
<!-- [More Information Needed] -->
<!-- ### Recommendations -->
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
<!-- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. -->
<!-- ## How to Get Started with the Model -->
<!-- Use the code below to get started with the model. -->
<!-- [More Information Needed] -->
<!-- ## Training Details -->