Question Answering
Transformers
PyTorch
TensorFlow
JAX
Vietnamese
t5
text2text-generation
summarization
translation
text-generation-inference
Instructions to use VietAI/vit5-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use VietAI/vit5-base with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="VietAI/vit5-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-base") model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/vit5-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,7 +23,7 @@ tokenizer = AutoTokenizer.from_pretrained("VietAI/vit5-base")
|
|
| 23 |
model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/vit5-base")
|
| 24 |
|
| 25 |
sentence = "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."
|
| 26 |
-
text = "
|
| 27 |
encoding = tokenizer.encode_plus(text, pad_to_max_length=True, return_tensors="pt")
|
| 28 |
input_ids, attention_masks = encoding["input_ids"].to("cuda"), encoding["attention_mask"].to("cuda")
|
| 29 |
outputs = model.generate(
|
|
|
|
| 23 |
model = AutoModelForSeq2SeqLM.from_pretrained("VietAI/vit5-base")
|
| 24 |
|
| 25 |
sentence = "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."
|
| 26 |
+
text = "vi: " + sentence
|
| 27 |
encoding = tokenizer.encode_plus(text, pad_to_max_length=True, return_tensors="pt")
|
| 28 |
input_ids, attention_masks = encoding["input_ids"].to("cuda"), encoding["attention_mask"].to("cuda")
|
| 29 |
outputs = model.generate(
|