File size: 404 Bytes
350813f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from model import Model

# Initialize the model
model = Model()

def predict(chunks):
    payload = {"chunks": chunks}
    return model(payload)

# Define Gradio interface
iface = gr.Interface(
    fn=predict,
    inputs=gr.Textbox(lines=2, placeholder="Enter text chunks separated by newline"),
    outputs=gr.JSON()
)

# Launch the app
if __name__ == "__main__":
    iface.launch()