abhi12ravi commited on
Commit
75eeaa2
1 Parent(s): 8cb193b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -1,13 +1,14 @@
1
- import gradio as gr
2
  import gradiohelper
 
 
3
 
 
4
 
5
-
6
- def predict_protection_level(title):
7
 
8
- status = gradiohelper.predict_protection_level(title)
9
 
10
- return status
11
 
12
- iface = gr.Interface(fn=predict_protection_level, inputs="text", outputs="text")
13
- iface.launch()
 
 
1
  import gradiohelper
2
+ predicted_protection_level_str = gradiohelper.predict_protection_level("Donald Trump")
3
+ print("Protection level:", predicted_protection_level_str)
4
 
5
+ import gradio as gr
6
 
7
+ def greet(name):
8
+ protection_level = gradiohelper.predict_protection_level("Donald Trump")
9
 
 
10
 
11
+ return "Predicted Protection Level: " + protection_level
12
 
13
+ iface = gr.Interface(fn=greet, inputs="text", outputs="text")
14
+ iface.launch(share=True)