currentlyexhausted's picture
Update app.py
ade1e2f
raw
history blame
430 Bytes
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)