diff --git "a/app.py" "b/app.py" --- "a/app.py" +++ "b/app.py" @@ -8,6 +8,11 @@ css = ''' .arrow{position: absolute;top: 0;right: -8px;margin-top: -8px !important} #component-4, #component-3, #component-10{min-height: 0} ''' +def swap_values_files(files): + if files: + return(len(files)*100) + else: + return 400 with gr.Blocks(css=css) as demo: with gr.Box(): # You can remove this part here for your local clone @@ -28,13 +33,15 @@ with gr.Blocks(css=css) as demo: gr.Textbox(label="What prompt you would like to train it on", value="The photo of a cttoy", interactive=True).style(container=False, item_container=False) gr.Markdown("You should try using words the model doesn't know. Don't use names or well known concepts.") with gr.Row(): - gr.File(label="Upload your images", file_count="multiple") + files = gr.File(label="Upload your images", file_count="multiple") with gr.Column(): gr.Markdown("You are going to train an `object`, upload 5-10 images of the object you are planning on training on from different angles/perspectives. You must have the right to do so and you are fully liable for image you use") gr.HTML('''''') with gr.Accordion("Advanced Settings", open=False): - pass + steps = gr.Number(label="How many steps", value=400) + + files.change(fn=swap_values_files, inputs=[files], outputs=[steps]) greet_btn = gr.Button("Start Training") greet_btn.click(fn=greet, inputs=[], outputs=[])