Spaces:
Runtime error
Runtime error
File size: 842 Bytes
6973085 66e0d8c 6973085 cf82463 8d85e64 6973085 cf82463 73adea4 cf82463 02e2d39 8d85e64 cf82463 8d85e64 3aaf0d3 646ce20 8d85e64 a8f674d a8cb60d 8d85e64 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import ktrain
import gradio as gr
from gradio.mix import Parallel
predictor_bert = ktrain.load_predictor('bert')
predictor_mental = ktrain.load_predictor('mentalbert')
# predictor_phs = ktrain.load_predictor('phsbert')
def func_bert(text):
results = predictor_bert.predict(str(text))
return str(results)
def func_mental(text):
results = predictor_mental.predict(str(text))
return str(results)
def func_phs(text):
results = predictor_phs.predict(str(text))
return str(results)
bert_io = gr.Interface(fn=func_bert, inputs="text", outputs="text")
mental_io = gr.Interface(fn=func_mental, inputs="text", outputs="text")
# phs_io = gr.Interface(fn=func_phs, inputs="text", outputs="text")
# Parallel(bert_io, mental_io, phs_io).launch()
Parallel(bert_io, mental_io).launch()
# bert_io.launch()
# mental_io.launch()
# phs_io.launch()
|