Update app.py
Browse files
app.py
CHANGED
@@ -255,19 +255,22 @@ with gr.Blocks() as demo:
|
|
255 |
train_batch_size,
|
256 |
gradient_accumulation_steps,
|
257 |
):
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
271 |
|
272 |
|
273 |
def immediate_update():
|
|
|
255 |
train_batch_size,
|
256 |
gradient_accumulation_steps,
|
257 |
):
|
258 |
+
try:
|
259 |
+
run_optimization = partial(
|
260 |
+
run_main,
|
261 |
+
num_tokens=int(num_tokens),
|
262 |
+
embedding_learning_rate = float(embedding_learning_rate),
|
263 |
+
max_emb_train_steps = int(max_emb_train_steps),
|
264 |
+
diffusion_model_learning_rate= float(diffusion_model_learning_rate),
|
265 |
+
max_diffusion_train_steps = int(max_diffusion_train_steps),
|
266 |
+
train_batch_size=int(train_batch_size),
|
267 |
+
gradient_accumulation_steps=int(gradient_accumulation_steps)
|
268 |
+
)
|
269 |
+
run_optimization()
|
270 |
+
print('finish')
|
271 |
+
return "Optimization finished!"
|
272 |
+
except:
|
273 |
+
return "CUDA out of memory, try another picture."
|
274 |
|
275 |
|
276 |
def immediate_update():
|