Spaces:
Runtime error
Runtime error
import gradio as gr | |
from predictOnce import Estimator | |
def predict(inputText): | |
global e | |
res = e.predict(inputText) | |
return res[0], res[1] | |
if __name__ == '__main__': | |
e = Estimator() | |
iface = gr.Interface(fn=e.predict, inputs=gr.inputs.Textbox(lines=2, label="输入语句", placeholder="输入要识别的语句..."), | |
outputs=[gr.outputs.Textbox(label="意图"), gr.outputs.Textbox(label="槽值")], live=True, | |
theme="huggingface", allow_screenshot=False, allow_flagging=False) | |
iface.launch(share=True) | |