pankaj9075rawat commited on
Commit
af822bc
·
verified ·
1 Parent(s): dbfbc03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -4,17 +4,17 @@ import gradio as gr
4
  # Function to call the FastAPI backend
5
  def predict(question1, question2, threshold):
6
 
7
- similarity, is_same = predict(question1, question2, threshold, verbose=True)
8
 
9
  return similarity, is_same
10
 
11
 
12
  # Launch the Gradio interface
13
  if __name__ == "__main__":
14
- gr.Interface(predict,
15
  inputs=[gr.Textbox(placeholder="Is Leonel Messi the Goat ?"),
16
  gr.Textbox(placeholder="Is Leonel Messi the best player ever?"),
17
  gr.Slider(minimum=0.0, maximum=1.0)],
18
- outputs=["number", "textbox"],
19
  description="This app tells us whether the two questions are similar or not"
20
- )
 
4
  # Function to call the FastAPI backend
5
  def predict(question1, question2, threshold):
6
 
7
+ similarity, is_same = pred(question1, question2, threshold, verbose=True)
8
 
9
  return similarity, is_same
10
 
11
 
12
  # Launch the Gradio interface
13
  if __name__ == "__main__":
14
+ gr.Interface(pred,
15
  inputs=[gr.Textbox(placeholder="Is Leonel Messi the Goat ?"),
16
  gr.Textbox(placeholder="Is Leonel Messi the best player ever?"),
17
  gr.Slider(minimum=0.0, maximum=1.0)],
18
+ outputs=[gr.Number(label="Similarity score"), gr.Textbox(label="Is similar?")],
19
  description="This app tells us whether the two questions are similar or not"
20
+ ).launch()