修改上传文件逻辑:不再删除文件、保留用户文件|增加用户获取历史上传记录

This commit is contained in:
w_xiaolizu
2023-04-20 16:19:48 +08:00
parent 8764ae3cb8
commit 472b6a88b4
7 changed files with 161 additions and 85 deletions

30
test.py
View File

@ -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()