publichealthsurveillance commited on
Commit
2b6482e
1 Parent(s): 8ea5273

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,7 +2,7 @@ import ktrain
2
  import gradio as gr
3
  from gradio.mix import Parallel
4
 
5
- examples = ["I only get my kids the ones I got....I've turned down many so called 'vaccines'", "Lol what? Measles is a real thing. Get vaccinated you wankers"]
6
 
7
  predictor_bert = ktrain.load_predictor('bert')
8
  predictor_mental = ktrain.load_predictor('mentalbert')
@@ -20,12 +20,12 @@ def phsbert(text):
20
  results = predictor_phs.predict(str(text))
21
  return str(results)
22
 
23
- bert_io = gr.Interface(fn=bert, inputs="text", outputs="text", examples=examples)
24
- mental_io = gr.Interface(fn=mentalbert, inputs="text", outputs="text", examples=examples)
25
  # phs_io = gr.Interface(fn=phsbert, inputs="text", outputs="text")
26
 
27
  # Parallel(bert_io, mental_io, phs_io).launch()
28
- Parallel(bert_io, mental_io).launch()
29
  # bert_io.launch()
30
  # mental_io.launch()
31
  # phs_io.launch()
 
2
  import gradio as gr
3
  from gradio.mix import Parallel
4
 
5
+ examples = [["I only get my kids the ones I got....I've turned down many so called 'vaccines'"], ["Lol what? Measles is a real thing. Get vaccinated you wankers"]]
6
 
7
  predictor_bert = ktrain.load_predictor('bert')
8
  predictor_mental = ktrain.load_predictor('mentalbert')
 
20
  results = predictor_phs.predict(str(text))
21
  return str(results)
22
 
23
+ bert_io = gr.Interface(fn=bert, inputs="text", outputs="text")
24
+ mental_io = gr.Interface(fn=mentalbert, inputs="text", outputs="text")
25
  # phs_io = gr.Interface(fn=phsbert, inputs="text", outputs="text")
26
 
27
  # Parallel(bert_io, mental_io, phs_io).launch()
28
+ Parallel(bert_io, mental_io, examples=examples).launch()
29
  # bert_io.launch()
30
  # mental_io.launch()
31
  # phs_io.launch()