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()