File size: 430 Bytes
d4b57d9
 
ade1e2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr

# Load the interface
question_gen = gr.Interface.load("models/allenai/t5-small-squad2-question-generation")

# Define the input text
text = "The quick brown fox jumps over the lazy dog."

# Generate multiple questions
num_questions = 5
questions = []
for i in range(num_questions):
    output = question_gen.predict(text)
    questions.append(output["generated_text"])

# Print the questions
print(questions)