修改上传文件逻辑:不再删除文件、保留用户文件|增加用户获取历史上传记录
This commit is contained in:
30
test.py
30
test.py
@ -20,6 +20,32 @@ with gr.Blocks() as demo:
|
||||
btn = gr.Button(value="Submit")
|
||||
btn.click(sentence_builder, inputs=[txt, txt_2], outputs=[txt_3])
|
||||
|
||||
if __name__ == "__main__":
|
||||
demo.launch()
|
||||
class ChatGPTForTester:
|
||||
|
||||
def __init__(self):
|
||||
self.demo = gr.Blocks()
|
||||
|
||||
def book(self):
|
||||
with self.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])
|
||||
|
||||
def book2(self):
|
||||
with self.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])
|
||||
|
||||
def main(self):
|
||||
self.book2()
|
||||
self.book()
|
||||
self.demo.launch()
|
||||
|
||||
if __name__ == "__main__":
|
||||
ChatGPTForTester().main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user