csv2md / app.py
Chris Pang
added input and outputs
ccf0104
raw
history blame
388 Bytes
import gradio as gr
import pandas as pd
def process_inputs(text, file):
data = pd.read_csv(file.name)
return f"{text}\n\n{data.to_string()}"
iface = gr.Interface(
fn=process_inputs,
inputs=[
gr.inputs.Textbox(lines=2, placeholder="OpenAI API"),
gr.inputs.File(type="csv", label="Upload CSV"),
],
outputs=gr.outputs.Textbox(),
)
iface.launch()