badayvedat commited on
Commit
b8ca77d
1 Parent(s): 61ed918

Bump max number of threads to 1024

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import json
2
  from collections import deque
3
  from dataclasses import dataclass
 
4
  from typing import Optional
5
 
6
  import gradio as gr
@@ -32,6 +33,7 @@ def get_initial_state() -> GenerationState:
32
 
33
  def load_initial_state(request: gr.Request) -> GenerationState:
34
  print("Loading initial state for", request.client.host)
 
35
 
36
  return get_initial_state()
37
 
@@ -200,4 +202,4 @@ with gr.Blocks(css="style.css", title=f"Realtime Latent Consistency Model") as d
200
  gr.Examples(examples=EXAMPLES, inputs=[prompt_box], label="Examples")
201
 
202
  if __name__ == "__main__":
203
- demo.queue(concurrency_count=20, api_open=False).launch(max_threads=64)
 
1
  import json
2
  from collections import deque
3
  from dataclasses import dataclass
4
+ import threading
5
  from typing import Optional
6
 
7
  import gradio as gr
 
33
 
34
  def load_initial_state(request: gr.Request) -> GenerationState:
35
  print("Loading initial state for", request.client.host)
36
+ print("Total number of active threads", threading.active_count())
37
 
38
  return get_initial_state()
39
 
 
202
  gr.Examples(examples=EXAMPLES, inputs=[prompt_box], label="Examples")
203
 
204
  if __name__ == "__main__":
205
+ demo.queue(concurrency_count=20, api_open=False).launch(max_threads=1024)