import gradio as gr import bap_preprocessing def tokenize(data): json_data = json.loads(data) response = bap_preprocessing.tokenize(json_data['text']) result = { "tokens": response } return result iface = gr.Interface(fn=tokenize, inputs="text", outputs="text") iface.launch()