Mikeplockhart commited on
Commit
0b54f43
1 Parent(s): e8c22b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,7 +48,8 @@ def search_chroma(query:str):
48
  query_embeddings=embedding_function([query]),
49
  n_results=5
50
  )
51
- return results
 
52
 
53
  def reranking_results(query: str, top_k_results: list[str]):
54
  # Load the model, here we use our base sized model
@@ -64,7 +65,7 @@ with gr.Blocks() as meal_search:
64
  gr.Markdown("Start typing below and then click **Run** to see the output.")
65
  with gr.Row():
66
  inp = gr.Textbox(placeholder="What sort of meal are you after?")
67
- out = gr.Textbox()
68
  btn = gr.Button("Run")
69
  btn.click(
70
  fn=run_query,
 
48
  query_embeddings=embedding_function([query]),
49
  n_results=5
50
  )
51
+ text_only= [f"# Dish:\n{item}\n\n" for item in results['documents']]
52
+ return "".join(text_only)
53
 
54
  def reranking_results(query: str, top_k_results: list[str]):
55
  # Load the model, here we use our base sized model
 
65
  gr.Markdown("Start typing below and then click **Run** to see the output.")
66
  with gr.Row():
67
  inp = gr.Textbox(placeholder="What sort of meal are you after?")
68
+ out = gr.MarkDown()
69
  btn = gr.Button("Run")
70
  btn.click(
71
  fn=run_query,