import gradio as gr import tools def generate(emoji): output = '' # Input handling emoji = emoji.replace(' ','').split(',') emoji= [s for s in emoji if s] # Find a matched unicode callback_u = [] for e in emoji: u_emoji = tools.emoji_to_unicode(e) output += f"{e} : {u_emoji}\n" callback_u.append(u_emoji) # Return unicodes back into the string print('Test: ',callback_u) output += "\nCallback Test\n" for u in callback_u: output += " " + tools.unicode_print(u) return output demo = gr.Interface(fn=generate, inputs="textbox", outputs="textbox") if __name__ == "__main__": demo.launch()