File size: 433 Bytes
3b87861 c451602 3b87861 c451602 dfa4c0a 12e6a54 c451602 12e6a54 c451602 d9217c2 3b87861 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import gradio as gr
import hashlib
def fx(x:str):
hash=hashlib.md5()
hash.update(x.encode(encoding='utf-8'))
return hash.hexdigest()
demo=gr.Blocks()
with demo:
text_input=gr.Textbox(placeholder='请输入测试字符串',label="请输入需要MD5加密的测试内容")
bb_button=gr.Button("运行")
bb_button.click(fx, inputs=text_input, outputs=gr.Textbox(label="输出"),api_name='md5')
demo.launch()
|