Update README.md
Browse files
README.md
CHANGED
|
@@ -24,8 +24,8 @@ To use it with transformers library take a look into the following code snippet:
|
|
| 24 |
# pip install accelerate
|
| 25 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 26 |
|
| 27 |
-
tokenizer = T5Tokenizer.from_pretrained("
|
| 28 |
-
model = T5ForConditionalGeneration.from_pretrained("
|
| 29 |
|
| 30 |
input_text = "Define sentiment of the following text: I love to travel and someday I will see the world."
|
| 31 |
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
|
|
|
|
| 24 |
# pip install accelerate
|
| 25 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
| 26 |
|
| 27 |
+
tokenizer = T5Tokenizer.from_pretrained("knowledgator/flan-t5-small-for-classification")
|
| 28 |
+
model = T5ForConditionalGeneration.from_pretrained("knowledgator/flan-t5-small-for-classification", device_map="auto")
|
| 29 |
|
| 30 |
input_text = "Define sentiment of the following text: I love to travel and someday I will see the world."
|
| 31 |
input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
|