Michelangiolo commited on
Commit
a6e68b0
1 Parent(s): 11db3b2

dual function

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -40,9 +40,18 @@ import gradio as gr
40
  import os
41
 
42
  #the first module becomes text1, the second module file1
43
- def greet(text1):
44
- return search1(text1, nbrs2, df3, df3)
45
- # return search1(text1, df, df2)
46
-
47
- iface = gr.Interface(fn=greet, inputs=['text'], outputs=["text"])
 
 
 
 
 
 
 
 
 
48
  iface.launch(share=False)
 
40
  import os
41
 
42
  #the first module becomes text1, the second module file1
43
+ def greet(type, text1):
44
+ if type == "sentence":
45
+ return search1(text1, nbrs2, df3, df3)
46
+ elif type == "paragraph":
47
+ return search1(text1, nbrs1, df, df2)
48
+
49
+ iface = gr.Interface(
50
+ fn=greet,
51
+ inputs=[
52
+ gr.Radio(["sentence", "paragraph"]),
53
+ gr.Textbox(label="text")
54
+ ],
55
+ outputs=["text"]
56
+ )
57
  iface.launch(share=False)