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]
Repository: [More Information Needed]
Paper [optional]: [More Information Needed]
Demo [optional]: [More Information Needed]
Uses
Direct Use
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
name_model = f"NguyenManhAI/translation-{SRC}-{TRG}-{KIND}"
model = AutoModelForSeq2SeqLM.from_pretrained(name_model)
tokenizer = AutoTokenizer.from_pretrained(name_model)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def predict(model, input_sentence, tokenizer):
# Dịch một câu hoàn chỉnh
# Token hóa câu đầu vào
inputs = tokenizer(input_sentence, return_tensors="pt", padding=True, truncation=True).to(device)
# Sử dụng mô hình để dự đoán
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens = 50)
# Giải mã đầu ra của mô hình
translated_sentence = tokenizer.decode(outputs[0], skip_special_tokens=True)
return translated_sentence
predict(model, input_sentence, tokenizer)
[More Information Needed]
Downstream Use [optional]
[More Information Needed]
Out-of-Scope Use
[More Information Needed]
Bias, Risks, and Limitations
[More Information Needed]
Recommendations
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.