Commit
·
0484b8c
1
Parent(s):
fbb3ef2
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,7 +65,7 @@ def load_captioning(uploaded_images, option):
|
|
| 65 |
|
| 66 |
def check_removed_and_restart(images):
|
| 67 |
visible = bool(images)
|
| 68 |
-
return [gr.update(visible=visible) for _ in range(
|
| 69 |
|
| 70 |
def make_options_visible(option):
|
| 71 |
if (option == "object") or (option == "face"):
|
|
@@ -719,13 +719,13 @@ To improve the quality of your outputs, you can add a custom caption for each im
|
|
| 719 |
label="Dataloader num workers", value=0, minimum=0, maximum=64
|
| 720 |
)
|
| 721 |
local_rank = gr.Number(label="local_rank", value=-1)
|
| 722 |
-
with gr.Row():
|
| 723 |
with gr.Group():
|
| 724 |
gr.Markdown('''### This training is estimated to cost <b>< US$ 1,50</b> with your current train settings
|
| 725 |
Grab a Hugging Face <b>write</b> token [here](https://huggingface.co/settings/tokens)
|
| 726 |
''')
|
| 727 |
token = gr.Textbox(label="Your Hugging Face write token", info="A Hugging Face write token you can obtain on the settings page")
|
| 728 |
-
with gr.Group() as no_payment_method:
|
| 729 |
with gr.Row():
|
| 730 |
gr.Markdown("Your Hugging Face account doesn't have a payment method. Set it up [here](https://huggingface.co/settings/billing/payment) to train your LoRA")
|
| 731 |
payment_setup = gr.Button("I have set up my payment method")
|
|
@@ -788,7 +788,7 @@ Grab a Hugging Face <b>write</b> token [here](https://huggingface.co/settings/to
|
|
| 788 |
images.change(
|
| 789 |
check_removed_and_restart,
|
| 790 |
inputs=[images],
|
| 791 |
-
outputs=[captioning_area, advanced],
|
| 792 |
)
|
| 793 |
training_option.change(
|
| 794 |
make_options_visible,
|
|
|
|
| 65 |
|
| 66 |
def check_removed_and_restart(images):
|
| 67 |
visible = bool(images)
|
| 68 |
+
return [gr.update(visible=visible) for _ in range(3)]
|
| 69 |
|
| 70 |
def make_options_visible(option):
|
| 71 |
if (option == "object") or (option == "face"):
|
|
|
|
| 719 |
label="Dataloader num workers", value=0, minimum=0, maximum=64
|
| 720 |
)
|
| 721 |
local_rank = gr.Number(label="local_rank", value=-1)
|
| 722 |
+
with gr.Row(visible=False) as cost_estimation:
|
| 723 |
with gr.Group():
|
| 724 |
gr.Markdown('''### This training is estimated to cost <b>< US$ 1,50</b> with your current train settings
|
| 725 |
Grab a Hugging Face <b>write</b> token [here](https://huggingface.co/settings/tokens)
|
| 726 |
''')
|
| 727 |
token = gr.Textbox(label="Your Hugging Face write token", info="A Hugging Face write token you can obtain on the settings page")
|
| 728 |
+
with gr.Group(visible=False) as no_payment_method:
|
| 729 |
with gr.Row():
|
| 730 |
gr.Markdown("Your Hugging Face account doesn't have a payment method. Set it up [here](https://huggingface.co/settings/billing/payment) to train your LoRA")
|
| 731 |
payment_setup = gr.Button("I have set up my payment method")
|
|
|
|
| 788 |
images.change(
|
| 789 |
check_removed_and_restart,
|
| 790 |
inputs=[images],
|
| 791 |
+
outputs=[captioning_area, advanced, cost_estimation],
|
| 792 |
)
|
| 793 |
training_option.change(
|
| 794 |
make_options_visible,
|