fffiloni commited on
Commit
10f070b
·
verified ·
1 Parent(s): 15a871c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -50,9 +50,10 @@ def get_sleep_time(hf_token):
50
  gcTimeout = response.json()['runtime']['gcTimeout']
51
  except:
52
  gcTimeout = None
 
53
  return gcTimeout
54
 
55
- sleep_time = get_sleep_time(hf_token)
56
 
57
  def train_dreambooth_blora_sdxl(instance_data_dir, b_lora_trained_folder, instance_prompt, class_prompt, max_train_steps, checkpoint_steps):
58
 
@@ -261,7 +262,7 @@ with gr.Blocks(css=css) as demo:
261
  with gr.Column():
262
  current_sleep_time = gr.Number(visible=False)
263
  print(f"loaded demo: {current_sleep_time['value']}")
264
- if sleep_time > 1 and sleep_time is not None:
265
  gr.HTML(f'''
266
  <div class="gr-prose">
267
  <h2>in order to train properly your B-LoRa, you need to set space sleep time to "Don't sleep"</h2>
@@ -287,7 +288,7 @@ with gr.Blocks(css=css) as demo:
287
  checkpoint_step = gr.Number(label="checkpoint step", visible=False, value=500)
288
 
289
 
290
- if sleep_time > 1 and sleep_time is not None:
291
  train_btn = gr.Button("Train B-LoRa", visible=False)
292
  else:
293
  train_btn = gr.Button("Train B-LoRa", visible=True)
 
50
  gcTimeout = response.json()['runtime']['gcTimeout']
51
  except:
52
  gcTimeout = None
53
+ sleep_time = gcTimeout
54
  return gcTimeout
55
 
56
+ #sleep_time = get_sleep_time(hf_token)
57
 
58
  def train_dreambooth_blora_sdxl(instance_data_dir, b_lora_trained_folder, instance_prompt, class_prompt, max_train_steps, checkpoint_steps):
59
 
 
262
  with gr.Column():
263
  current_sleep_time = gr.Number(visible=False)
264
  print(f"loaded demo: {current_sleep_time['value']}")
265
+ if sleep_time is not None and sleep_time > 1:
266
  gr.HTML(f'''
267
  <div class="gr-prose">
268
  <h2>in order to train properly your B-LoRa, you need to set space sleep time to "Don't sleep"</h2>
 
288
  checkpoint_step = gr.Number(label="checkpoint step", visible=False, value=500)
289
 
290
 
291
+ if sleep_time is not None and sleep_time > 1:
292
  train_btn = gr.Button("Train B-LoRa", visible=False)
293
  else:
294
  train_btn = gr.Button("Train B-LoRa", visible=True)