fukugawa commited on
Commit
b4e3e44
·
1 Parent(s): 775cc76

Fix ZeroGPU quota exceeded bug

Browse files
Files changed (1) hide show
  1. indiebot_arena/ui/battle.py +4 -5
indiebot_arena/ui/battle.py CHANGED
@@ -85,11 +85,10 @@ def submit_message(message, history_a, history_b, model_a, model_b):
85
  history_b.append((message, ""))
86
  conv_history_a = format_chat_history(history_a[:-1])
87
  conv_history_b = format_chat_history(history_b[:-1])
88
- with concurrent.futures.ThreadPoolExecutor() as executor:
89
- future_a = executor.submit(generate, message, conv_history_a, model_a)
90
- future_b = executor.submit(generate, message, conv_history_b, model_b)
91
- response_a = future_a.result()
92
- response_b = future_b.result()
93
  history_a[-1] = (message, response_a)
94
  history_b[-1] = (message, response_b)
95
  return history_a, history_b, "", gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=False)
 
85
  history_b.append((message, ""))
86
  conv_history_a = format_chat_history(history_a[:-1])
87
  conv_history_b = format_chat_history(history_b[:-1])
88
+
89
+ response_a = generate(message, conv_history_a, model_a)
90
+ response_b = generate(message, conv_history_b, model_b)
91
+
 
92
  history_a[-1] = (message, response_a)
93
  history_b[-1] = (message, response_b)
94
  return history_a, history_b, "", gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=False)