DevBM commited on
Commit
f1ae702
·
verified ·
1 Parent(s): 863a177

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Load your model
4
+ model = gr.load("models/DevBM/t5-large-squad")
5
+
6
+ # Define the input and output interfaces
7
+ inputs = gr.inputs.Textbox(label="Question")
8
+ output = gr.outputs.Textbox(label="Answer")
9
+
10
+ # Define examples that users can select from
11
+ examples = [
12
+ ["What is the capital of France?", ""],
13
+ ["Who wrote the Harry Potter series?", ""],
14
+ ["What is the largest planet in our solar system?", ""]
15
+ ]
16
+
17
+ # Launch the Gradio interface with examples
18
+ gr.Interface(fn=model.predict, inputs=inputs, outputs=output, examples=examples).launch()