geeek commited on
Commit
9b6a25f
·
1 Parent(s): 8945d5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -4,9 +4,13 @@ from detoxify import Detoxify
4
  # each model takes in either a string or a list of strings
5
 
6
  def greet(text):
7
- results = Detoxify('original').predict(text)
 
8
 
9
- return results
 
 
 
10
 
11
- iface = gr.Interface(fn=greet, inputs="Enter Text to Classify", outputs=" Original Classification",api_name='classify')
12
  iface.launch(show_api='true')
 
4
  # each model takes in either a string or a list of strings
5
 
6
  def greet(text):
7
+ original = Detoxify('original').predict(text)
8
+ unbiased = Detoxify('unbiased').predict(text)
9
 
10
+ return {
11
+ 'original':original,
12
+ 'unbiased':unbiased
13
+ }
14
 
15
+ iface = gr.Interface(fn=greet, inputs="Enter Text to Classify", outputs="Classification",api_name='classify')
16
  iface.launch(show_api='true')