Spaces:
Runtime error
Runtime error
Rate control
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import re
|
|
2 |
import json
|
3 |
import gradio as gr
|
4 |
from glob import glob
|
|
|
5 |
|
6 |
from chatarena.arena import Arena, TooManyInvalidActions
|
7 |
from chatarena.backends import BACKEND_REGISTRY
|
@@ -244,6 +245,7 @@ Prompting multiple AI agents to play games in a language-driven environment.
|
|
244 |
def step_game(all_comps: dict):
|
245 |
yield {btn_step: gr.update(value="Running...", interactive=False),
|
246 |
btn_restart: gr.update(interactive=False)}
|
|
|
247 |
|
248 |
cur_state = all_comps[state]
|
249 |
|
@@ -374,5 +376,5 @@ Prompting multiple AI agents to play games in a language-driven environment.
|
|
374 |
|
375 |
example_selector.change(update_components_from_example, set(all_components + [state]), all_components + [state])
|
376 |
|
377 |
-
demo.queue(concurrency_count=
|
378 |
demo.launch(debug=DEBUG)
|
|
|
2 |
import json
|
3 |
import gradio as gr
|
4 |
from glob import glob
|
5 |
+
from time import sleep
|
6 |
|
7 |
from chatarena.arena import Arena, TooManyInvalidActions
|
8 |
from chatarena.backends import BACKEND_REGISTRY
|
|
|
245 |
def step_game(all_comps: dict):
|
246 |
yield {btn_step: gr.update(value="Running...", interactive=False),
|
247 |
btn_restart: gr.update(interactive=False)}
|
248 |
+
sleep(20) # control the rate of requests
|
249 |
|
250 |
cur_state = all_comps[state]
|
251 |
|
|
|
376 |
|
377 |
example_selector.change(update_components_from_example, set(all_components + [state]), all_components + [state])
|
378 |
|
379 |
+
demo.queue(concurrency_count=10) # To improve concurrency
|
380 |
demo.launch(debug=DEBUG)
|