currentlyexhausted commited on
Commit
ade1e2f
·
1 Parent(s): d4b57d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,3 +1,17 @@
1
  import gradio as gr
2
 
3
- gr.Interface.load("models/allenai/t5-small-squad2-question-generation").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ # Load the interface
4
+ question_gen = gr.Interface.load("models/allenai/t5-small-squad2-question-generation")
5
+
6
+ # Define the input text
7
+ text = "The quick brown fox jumps over the lazy dog."
8
+
9
+ # Generate multiple questions
10
+ num_questions = 5
11
+ questions = []
12
+ for i in range(num_questions):
13
+ output = question_gen.predict(text)
14
+ questions.append(output["generated_text"])
15
+
16
+ # Print the questions
17
+ print(questions)