Update README.md
Browse files
README.md
CHANGED
|
@@ -8,11 +8,11 @@ Tags:
|
|
| 8 |
- T5
|
| 9 |
- text-generation-inference
|
| 10 |
---
|
| 11 |
-
Model Card for
|
| 12 |
|
| 13 |
Model Details
|
| 14 |
|
| 15 |
-
Model Name:
|
| 16 |
|
| 17 |
Model Description: This model can generate MCQs from a given passage.
|
| 18 |
|
|
@@ -44,18 +44,18 @@ Usage
|
|
| 44 |
Example Usage:
|
| 45 |
|
| 46 |
Python
|
| 47 |
-
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
--------------
|
| 52 |
prompt ='''Your Prompt'''
|
| 53 |
|
| 54 |
input_text = f"{prompt}: {passage.strip()}"
|
| 55 |
|
| 56 |
-
input_ids =
|
| 57 |
|
| 58 |
-
outputs =
|
| 59 |
|
| 60 |
input_ids,
|
| 61 |
|
|
@@ -69,6 +69,6 @@ outputs = easy_model.generate(
|
|
| 69 |
|
| 70 |
)
|
| 71 |
|
| 72 |
-
output_text =
|
| 73 |
|
| 74 |
print(output_text)
|
|
|
|
| 8 |
- T5
|
| 9 |
- text-generation-inference
|
| 10 |
---
|
| 11 |
+
Model Card for Medium_QG_Generator
|
| 12 |
|
| 13 |
Model Details
|
| 14 |
|
| 15 |
+
Model Name: Medium_QG_Generator
|
| 16 |
|
| 17 |
Model Description: This model can generate MCQs from a given passage.
|
| 18 |
|
|
|
|
| 44 |
Example Usage:
|
| 45 |
|
| 46 |
Python
|
| 47 |
+
medium_model = T5ForConditionalGeneration.from_pretrained("goenkalokesh/Medium_QG_Generator")
|
| 48 |
|
| 49 |
+
medium_tokenizer = T5Tokenizer.from_pretrained("goenkalokesh/Medium_QG_Generator")
|
| 50 |
|
| 51 |
--------------
|
| 52 |
prompt ='''Your Prompt'''
|
| 53 |
|
| 54 |
input_text = f"{prompt}: {passage.strip()}"
|
| 55 |
|
| 56 |
+
input_ids = medium_tokenizer.encode(input_text, return_tensors='pt')
|
| 57 |
|
| 58 |
+
outputs = medium_model.generate(
|
| 59 |
|
| 60 |
input_ids,
|
| 61 |
|
|
|
|
| 69 |
|
| 70 |
)
|
| 71 |
|
| 72 |
+
output_text = medium_tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 73 |
|
| 74 |
print(output_text)
|