phenomenon1981 commited on
Commit
a241304
1 Parent(s): aadb74c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -14,7 +14,7 @@ proc5=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
14
 
15
 
16
  def add_random_noise(prompt, noise_level=0.1):
17
- noise = "".join(random.choices(string.ascii_letters + string.punctuation, k=int(noise_level * 10)))
18
  return prompt + noise
19
 
20
  queue_length_counter = 0
@@ -177,5 +177,9 @@ with gr.Blocks() as myface:
177
 
178
 
179
 
180
- myface.queue(concurrency_count=8)
181
- myface.launch(enable_queue=True, inline=True)
 
 
 
 
 
14
 
15
 
16
  def add_random_noise(prompt, noise_level=0.1):
17
+ noise = "".join(random.choices(string.ascii_letters + string.punctuation, k=int(noise_level * 20)))
18
  return prompt + noise
19
 
20
  queue_length_counter = 0
 
177
 
178
 
179
 
180
+ myface.queue(concurrency_count=8)
181
+ myface.launch(enable_queue=True, inline=True)
182
+ while True:
183
+ if queue.qsize() >= 100:
184
+ queue.queue.clear()
185
+ time.sleep(30)