mwitiderrick commited on
Commit
e339a03
1 Parent(s): 6d0b4f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -20
app.py CHANGED
@@ -46,36 +46,28 @@ def run_pipeline(text):
46
 
47
 
48
  with gr.Blocks() as demo:
49
- gr.Markdown(markdownn)
50
-
51
- with gr.Row():
52
- text = gr.Text(label="Text")
53
-
54
  with gr.Row():
55
  with gr.Column():
56
- dense_duration = gr.Number(label="Dense Latency (ms):")
57
- dense_answers = gr.Textbox(label="Dense model answer")
58
 
59
  with gr.Column():
60
- sparse_duration = gr.Number(label="Sparse Latency (ms):")
 
 
 
 
 
 
 
61
  sparse_answers = gr.Textbox(label="Sparse model answers")
62
-
63
- btn = gr.Button("Submit")
 
64
  btn.click(
65
  run_pipeline,
66
  inputs=[text],
67
  outputs=[sparse_answers,sparse_duration,dense_answers,dense_duration],
68
  )
69
 
70
-
71
- gr.Examples(
72
- [
73
- ["Who are you voting for in 2020?"],
74
- ["Public health is very important"]
75
- ],
76
- inputs=[text],
77
- )
78
-
79
-
80
  if __name__ == "__main__":
81
  demo.launch()
 
46
 
47
 
48
  with gr.Blocks() as demo:
 
 
 
 
 
49
  with gr.Row():
50
  with gr.Column():
51
+ gr.Markdown(markdownn)
 
52
 
53
  with gr.Column():
54
+ gr.Markdown("""
55
+ ### Text classification demo
56
+ """)
57
+ text = gr.Text(label="Text")
58
+ btn = gr.Button("Submit")
59
+ dense_answers = gr.Textbox(label="Dense model answer")
60
+ dense_duration = gr.Number(label="Dense Latency (ms):")
61
+
62
  sparse_answers = gr.Textbox(label="Sparse model answers")
63
+ sparse_duration = gr.Number(label="Sparse Latency (ms):")
64
+ gr.Examples([["Who are you voting for in 2020?"],["Public health is very important"]],inputs=[text],)
65
+
66
  btn.click(
67
  run_pipeline,
68
  inputs=[text],
69
  outputs=[sparse_answers,sparse_duration,dense_answers,dense_duration],
70
  )
71
 
 
 
 
 
 
 
 
 
 
 
72
  if __name__ == "__main__":
73
  demo.launch()