import gradio as gr import utils def setup(collection): data_loads = utils.load_data() #print(data_loads) utils.chroma_upserting(collection, data_loads) def run_query(query_string: str): meal_string = util.search_chroma() return meal_string if __name__ == "__main__": collection = utils.chroma_client_setup() setup(collection) with gr.Blocks() as meal_search: gr.Markdown("Start typing below and then click **Run** to see the output.") with gr.Row(): inp = gr.Textbox(placeholder="What sort of meal are you after?") out = gr.Textbox() btn = gr.Button("Run") btn.click(fn=run_query, inputs=inp, outputs=out) meal_search.launch()