Update README.md
Browse files
README.md
CHANGED
|
@@ -3,6 +3,31 @@ library_name: transformers
|
|
| 3 |
tags: []
|
| 4 |
---
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
| 3 |
tags: []
|
| 4 |
---
|
| 5 |
|
| 6 |
+
#Getting started
|
| 7 |
+
!pip install transformers
|
| 8 |
+
|
| 9 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
| 10 |
+
|
| 11 |
+
# Load the model and tokenizer from the directory where they are saved
|
| 12 |
+
model = T5ForConditionalGeneration.from_pretrained('abhibheema/T5Validation')
|
| 13 |
+
tokenizer = T5Tokenizer.from_pretrained('abhibheema/T5Validation')
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
sample_input = """input text"""
|
| 18 |
+
input_ids = tokenizer.encode(sample_input, return_tensors="pt")
|
| 19 |
+
# Generate output
|
| 20 |
+
with torch.no_grad():
|
| 21 |
+
output_ids = model.generate(input_ids, max_new_tokens=512)
|
| 22 |
+
output_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 23 |
+
# Print the result
|
| 24 |
+
print("Generated Output:", output_text)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
# Model Card for Model ID
|
| 32 |
|
| 33 |
<!-- Provide a quick summary of what the model is/does. -->
|