Pavithiran commited on
Commit
350813f
·
verified ·
1 Parent(s): c33e764

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from model import Model
3
+
4
+ # Initialize the model
5
+ model = Model()
6
+
7
+ def predict(chunks):
8
+ payload = {"chunks": chunks}
9
+ return model(payload)
10
+
11
+ # Define Gradio interface
12
+ iface = gr.Interface(
13
+ fn=predict,
14
+ inputs=gr.Textbox(lines=2, placeholder="Enter text chunks separated by newline"),
15
+ outputs=gr.JSON()
16
+ )
17
+
18
+ # Launch the app
19
+ if __name__ == "__main__":
20
+ iface.launch()