Update utils/quiz_offline.py
Browse files- utils/quiz_offline.py +2 -0
utils/quiz_offline.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
def generate_mcqs(text, num_questions=1):
|
2 |
input_text = f"generate question: {text}"
|
|
|
3 |
input_ids = tokenizer.encode(input_text, return_tensors="pt", max_length=512, truncation=True)
|
4 |
|
5 |
questions = []
|
@@ -11,6 +12,7 @@ def generate_mcqs(text, num_questions=1):
|
|
11 |
temperature=0.7
|
12 |
)
|
13 |
decoded = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
14 |
questions.append(decoded.strip())
|
15 |
|
16 |
# Join all questions into one string for Gradio output
|
|
|
1 |
def generate_mcqs(text, num_questions=1):
|
2 |
input_text = f"generate question: {text}"
|
3 |
+
print(input_text)
|
4 |
input_ids = tokenizer.encode(input_text, return_tensors="pt", max_length=512, truncation=True)
|
5 |
|
6 |
questions = []
|
|
|
12 |
temperature=0.7
|
13 |
)
|
14 |
decoded = tokenizer.decode(output[0], skip_special_tokens=True)
|
15 |
+
print(decoded)
|
16 |
questions.append(decoded.strip())
|
17 |
|
18 |
# Join all questions into one string for Gradio output
|