Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ def generate_mcqs(text, num_questions=5):
|
|
| 25 |
inputs = tokenizer(text, return_tensors="pt", max_length=max_input_length, truncation=True)
|
| 26 |
|
| 27 |
mcqs = []
|
| 28 |
-
generator = pipeline("
|
| 29 |
for _ in range(num_questions):
|
| 30 |
# Generate a single MCQ at a time
|
| 31 |
mcq = generator(tokenizer.decode(inputs['input_ids'][0]), max_new_tokens=100)[0]["generated_text"]
|
|
|
|
| 25 |
inputs = tokenizer(text, return_tensors="pt", max_length=max_input_length, truncation=True)
|
| 26 |
|
| 27 |
mcqs = []
|
| 28 |
+
generator = pipeline("document-question-answering", model=model, tokenizer=tokenizer)
|
| 29 |
for _ in range(num_questions):
|
| 30 |
# Generate a single MCQ at a time
|
| 31 |
mcq = generator(tokenizer.decode(inputs['input_ids'][0]), max_new_tokens=100)[0]["generated_text"]
|