CoolFace
Apppublic

tansylusha/benchmarking

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes
interface.py21 linesDownload Raw Back to root
1import gradio as gr2from process_user_input import match 3# with gr.Blocks() as demo:4#     name = gr.Textbox(label="Name")5#     output = gr.Textbox(label="Output Box")6#     greet_btn = gr.Button("Greet")7#     greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet")8   9#on first run, run the embed_food_emissions file to obtain embeddings for the reference database10demo = gr.Interface(fn=match,11                     inputs="text", 12                    13                    outputs=[         # List of output fields14                            gr.outputs.Textbox(label="Product Type Name"),15                            gr.outputs.Textbox(label="Product Type"),16                            gr.outputs.Textbox(label="Carbon Footprint"),17                            gr.outputs.Textbox(label="Unit"),18                            gr.outputs.Textbox(label="Country Code")19                        ],20                    title="Match your food item to a carbon emissions category")21demo.launch()