yuntian-deng commited on
Commit
b15c3f8
1 Parent(s): f595a08

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -8,6 +8,9 @@ MODEL = "gpt-4"
8
  API_URL = os.getenv("API_URL")
9
  DISABLED = os.getenv("DISABLED") == 'True'
10
  OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
 
 
 
11
 
12
  def exception_handler(exception_type, exception, traceback):
13
  print("%s: %s" % (exception_type.__name__, exception))
@@ -186,4 +189,4 @@ with gr.Blocks(css = """#col_container { margin-left: auto; margin-right: auto;}
186
  b1.click(reset_textbox, [], [inputs, b1], queue=False)
187
  b1.click(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code, inputs, b1],) #openai_api_key
188
 
189
- demo.queue(max_size=20, concurrency_count=2, api_open=False).launch()
 
8
  API_URL = os.getenv("API_URL")
9
  DISABLED = os.getenv("DISABLED") == 'True'
10
  OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
11
+ NUM_THREADS = int(os.getenv("NUM_THREADS"))
12
+
13
+ print (NUM_THREADS)
14
 
15
  def exception_handler(exception_type, exception, traceback):
16
  print("%s: %s" % (exception_type.__name__, exception))
 
189
  b1.click(reset_textbox, [], [inputs, b1], queue=False)
190
  b1.click(predict, [inputs, top_p, temperature, chat_counter, chatbot, state], [chatbot, state, chat_counter, server_status_code, inputs, b1],) #openai_api_key
191
 
192
+ demo.queue(max_size=20, concurrency_count=NUM_THREADS, api_open=False).launch()