rachith commited on
Commit
052fd21
·
1 Parent(s): 76e5451

resolving bug with interface

Browse files
Files changed (1) hide show
  1. app.py +18 -13
app.py CHANGED
@@ -38,16 +38,21 @@ def topk(word,model):
38
 
39
  return outs
40
 
41
- with gr.Blocks() as demo:
42
- gr.Markdown(f" # {title}")
43
- # gr.Markdown(f" ## {description1}")
44
- # gr.Markdown(f"{description2}")
45
- # gr.Markdown(f"{description3}")
46
- with gr.Row():
47
- word = gr.Textbox(label="Word")
48
- with gr.Row():
49
- greet_btn = gr.Button("Compute")
50
- with gr.Row():
51
- greet_btn.click(fn=topk, inputs=[word,gr.Dropdown(models)], outputs=gr.outputs.Textbox())
52
-
53
- demo.launch()
 
 
 
 
 
 
38
 
39
  return outs
40
 
41
+ # with gr.Blocks() as demo:
42
+ # gr.Markdown(f" # {title}")
43
+ # # gr.Markdown(f" ## {description1}")
44
+ # # gr.Markdown(f"{description2}")
45
+ # # gr.Markdown(f"{description3}")
46
+ # with gr.Row():
47
+ # word = gr.Textbox(label="Word")
48
+ # with gr.Row():
49
+ # greet_btn = gr.Button("Compute")
50
+ # with gr.Row():
51
+ # greet_btn.click(fn=topk, inputs=[word,gr.Dropdown(models)], outputs=gr.outputs.Textbox())
52
+ demo.launch()
53
+
54
+ interface = gr.Interface(fn=topk,
55
+ inputs=[gr.Textbox(label="Word"), gr.Dropdown(models)],
56
+ outputs=gr.outputs.Textbox()
57
+ )
58
+ interface.launch()