Commit
•
3e27b3e
1
Parent(s):
82cf36d
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from PIL import Image
|
|
3 |
import requests
|
4 |
import subprocess
|
5 |
from transformers import Blip2Processor, Blip2ForConditionalGeneration
|
6 |
-
from huggingface_hub import snapshot_download
|
7 |
import torch
|
8 |
import uuid
|
9 |
import os
|
@@ -114,6 +114,7 @@ def change_defaults(option, images):
|
|
114 |
return max_train_steps, repeats, lr_scheduler, rank, with_prior_preservation, class_prompt, random_files
|
115 |
|
116 |
def create_dataset(*inputs):
|
|
|
117 |
images = inputs[0]
|
118 |
destination_folder = str(uuid.uuid4())
|
119 |
print(destination_folder)
|
@@ -186,6 +187,7 @@ def start_training(
|
|
186 |
token,
|
187 |
progress = gr.Progress(track_tqdm=True)
|
188 |
):
|
|
|
189 |
slugged_lora_name = slugify(lora_name)
|
190 |
spacerunner_folder = str(uuid.uuid4())
|
191 |
commands = [
|
@@ -702,7 +704,7 @@ To improve the quality of your outputs, you can add a custom caption for each im
|
|
702 |
local_rank = gr.Number(label="local_rank", value=-1)
|
703 |
token = gr.Textbox(label="Your Hugging Face write token", info="A Hugging Face write token you can obtain on the [settings page](#).")
|
704 |
start = gr.Button("Start training", visible=False)
|
705 |
-
progress_area = gr.HTML()
|
706 |
output_components.insert(1, advanced)
|
707 |
output_components.insert(1, start)
|
708 |
use_snr_gamma.change(
|
|
|
3 |
import requests
|
4 |
import subprocess
|
5 |
from transformers import Blip2Processor, Blip2ForConditionalGeneration
|
6 |
+
from huggingface_hub import snapshot_download, HfApi
|
7 |
import torch
|
8 |
import uuid
|
9 |
import os
|
|
|
114 |
return max_train_steps, repeats, lr_scheduler, rank, with_prior_preservation, class_prompt, random_files
|
115 |
|
116 |
def create_dataset(*inputs):
|
117 |
+
print("Creating dataset")
|
118 |
images = inputs[0]
|
119 |
destination_folder = str(uuid.uuid4())
|
120 |
print(destination_folder)
|
|
|
187 |
token,
|
188 |
progress = gr.Progress(track_tqdm=True)
|
189 |
):
|
190 |
+
print("Started training")
|
191 |
slugged_lora_name = slugify(lora_name)
|
192 |
spacerunner_folder = str(uuid.uuid4())
|
193 |
commands = [
|
|
|
704 |
local_rank = gr.Number(label="local_rank", value=-1)
|
705 |
token = gr.Textbox(label="Your Hugging Face write token", info="A Hugging Face write token you can obtain on the [settings page](#).")
|
706 |
start = gr.Button("Start training", visible=False)
|
707 |
+
progress_area = gr.HTML("...")
|
708 |
output_components.insert(1, advanced)
|
709 |
output_components.insert(1, start)
|
710 |
use_snr_gamma.change(
|