Mikeplockhart commited on
Commit
02b7760
1 Parent(s): 30a523b

Update app.py

Browse files

Rejoin collection

Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -1,15 +1,24 @@
1
  import gradio as gr
 
 
 
 
 
2
 
3
  def run_query(query_string: str):
4
- meal_string = f"Oh you want {query_string}. Go have a think yourself then."
5
  return meal_string
6
 
7
- with gr.Blocks() as meal_search:
8
- gr.Markdown("Start typing below and then click **Run** to see the output.")
9
- with gr.Row():
10
- inp = gr.Textbox(placeholder="What sort of meal are you after?")
11
- out = gr.Textbox()
12
- btn = gr.Button("Run")
13
- btn.click(fn=run_query, inputs=inp, outputs=out)
 
 
 
 
 
14
 
15
- meal_search.launch()
 
1
  import gradio as gr
2
+ import utils
3
+
4
+ def setup(collection):
5
+ data_loads = utils.load_data()
6
+ utils.chroma_upserting(collection, data_loads)
7
 
8
  def run_query(query_string: str):
9
+ meal_string = util.search_chroma()
10
  return meal_string
11
 
12
+ if __name__ == "__main__":
13
+ collection = utils.chroma_client_setup()
14
+ setup(collection)
15
+ with gr.Blocks() as meal_search:
16
+ gr.Markdown("Start typing below and then click **Run** to see the output.")
17
+ with gr.Row():
18
+ inp = gr.Textbox(placeholder="What sort of meal are you after?")
19
+ out = gr.Textbox()
20
+ btn = gr.Button("Run")
21
+ btn.click(fn=run_query, inputs=inp, outputs=out)
22
+
23
+ meal_search.launch()
24