1littlecoder commited on
Commit
152990b
1 Parent(s): af931dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -24,7 +24,6 @@ def topk_candidates(query, candidates, k):
24
  topk = wl.topk(query, candidates, k)
25
  return topk
26
 
27
- # Define the Gradio interface
28
  def create_gradio_interface():
29
  with gr.Blocks() as demo:
30
  gr.Markdown("## WordLlama Gradio Demo")
@@ -43,7 +42,7 @@ def create_gradio_interface():
43
  with gr.Tab("Rank Documents"):
44
  query = gr.Textbox(label="Query", placeholder="Enter the query here...")
45
  candidates = gr.Textbox(label="Candidates (comma separated)", placeholder="Enter candidate sentences here...")
46
- ranked_docs_output = gr.Dataframe(headers=["Document", "Score"], datatype=["str", "float"])
47
  gr.Button("Rank Documents").click(
48
  fn=lambda q, c: rank_documents(q, c.split(',')),
49
  inputs=[query, candidates],
@@ -86,4 +85,4 @@ def create_gradio_interface():
86
 
87
  # Create and launch the Gradio interface
88
  demo = create_gradio_interface()
89
- demo.launch(debug = True)
 
24
  topk = wl.topk(query, candidates, k)
25
  return topk
26
 
 
27
  def create_gradio_interface():
28
  with gr.Blocks() as demo:
29
  gr.Markdown("## WordLlama Gradio Demo")
 
42
  with gr.Tab("Rank Documents"):
43
  query = gr.Textbox(label="Query", placeholder="Enter the query here...")
44
  candidates = gr.Textbox(label="Candidates (comma separated)", placeholder="Enter candidate sentences here...")
45
+ ranked_docs_output = gr.Dataframe(headers=["Document", "Score"])
46
  gr.Button("Rank Documents").click(
47
  fn=lambda q, c: rank_documents(q, c.split(',')),
48
  inputs=[query, candidates],
 
85
 
86
  # Create and launch the Gradio interface
87
  demo = create_gradio_interface()
88
+ demo.launch()