samp / app.py
Pavithiran's picture
Create app.py
350813f verified
raw
history blame contribute delete
404 Bytes
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()