Question Answering
Transformers
PyTorch
TensorFlow
JAX
Vietnamese
t5
text2text-generation
summarization
translation
text-generation-inference
Instructions to use VietAI/envit5-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VietAI/envit5-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="VietAI/envit5-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("VietAI/envit5-base") model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/envit5-base") - Notebooks
- Google Colab
- Kaggle
Commit ·
566dbc9
1
Parent(s): 40d2ad6
Update README.md
Browse files
README.md
CHANGED
|
@@ -25,6 +25,19 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained("VietAI/envit5-base")
|
| 26 |
model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/envit5-base")
|
| 27 |
model.cuda()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
```
|
| 29 |
|
| 30 |
## Citation
|
|
|
|
| 25 |
tokenizer = AutoTokenizer.from_pretrained("VietAI/envit5-base")
|
| 26 |
model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/envit5-base")
|
| 27 |
model.cuda()
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
# need prefix for en: and vi: sentences
|
| 31 |
+
inputs = [
|
| 32 |
+
"vi: VietAI là tổ chức phi lợi nhuận với sứ mệnh ươm mầm tài năng về trí tuệ nhân tạo và xây dựng một cộng đồng các chuyên gia trong lĩnh vực trí tuệ nhân tạo đẳng cấp quốc tế tại Việt Nam.",
|
| 33 |
+
"vi: Theo báo cáo mới nhất của Linkedin về danh sách việc làm triển vọng với mức lương hấp dẫn năm 2020, các chức danh công việc liên quan đến AI như Chuyên gia AI (Artificial Intelligence Specialist), Kỹ sư ML (Machine Learning Engineer) đều xếp thứ hạng cao.",
|
| 34 |
+
"en: Our teams aspire to make discoveries that impact everyone, and core to our approach is sharing our research and tools to fuel progress in the field.",
|
| 35 |
+
"en: We're on a journey to advance and democratize artificial intelligence through open source and open science."
|
| 36 |
+
]
|
| 37 |
+
|
| 38 |
+
outputs = model.generate(tokenizer(inputs, return_tensors="pt", padding=True).input_ids.to('cuda'), max_length=512)
|
| 39 |
+
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
| 40 |
+
|
| 41 |
```
|
| 42 |
|
| 43 |
## Citation
|