File size: 725 Bytes
fbc7e49
02b7760
 
 
 
0bb26ab
02b7760
fbc7e49
 
02b7760
c77bb9e
fbc7e49
02b7760
 
 
 
 
 
 
 
 
 
 
 
fbc7e49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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()