搞点东西

This commit is contained in:
w_xiaolizu
2023-04-19 18:37:43 +08:00
parent 7bb005c13b
commit b8e20f5aae
8 changed files with 65 additions and 21 deletions

25
test.py Normal file
View File

@ -0,0 +1,25 @@
#! .\venv\
# encoding: utf-8
# @Time : 2023/4/19
# @Author : Spike
# @Descr :
import gradio as gr
def sentence_builder(quantity, xixi):
return f"{quantity}_{xixi}"
with gr.Blocks() as demo:
txt = gr.Textbox(label="Input", lines=2)
txt_2 = gr.CheckboxGroup(['USA', "Japan"], value=['USA'], label='你好呀')
txt_3 = gr.Textbox(value="", label="Output")
btn = gr.Button(value="Submit")
btn.click(sentence_builder, inputs=[txt, txt_2], outputs=[txt_3])
if __name__ == "__main__":
demo.launch()