yuxwu commited on
Commit
54ddee0
·
1 Parent(s): 9a128be

Update to v0.1.9

Browse files
app.py CHANGED
@@ -2,7 +2,6 @@ import re
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
@@ -102,7 +101,6 @@ with gr.Blocks(css=css) as demo:
102
  gr.Markdown("""# 🏟 ChatArena️<br>
103
  Prompting multiple AI agents to play games in a language-driven environment.
104
  **[Project Homepage](https://github.com/chatarena/chatarena)**""", elem_id="header")
105
- # ## Due to the high volume of requests, our OpenAI API Token exceeded the billing limit. We are approaching OpenAI to get the research access at the moment. We encourage users to run the demo locally following [this instruction](https://github.com/chatarena/chatarena#launch-the-demo-locally).""", elem_id="header")
106
 
107
  with gr.Row():
108
  env_selector = gr.Dropdown(choices=list(ENV_REGISTRY.keys()), value=DEFAULT_ENV, interactive=True,
@@ -175,8 +173,6 @@ Prompting multiple AI agents to play games in a language-driven environment.
175
  with gr.Row():
176
  btn_step = gr.Button("Start")
177
  btn_restart = gr.Button("Clear")
178
- gr.HTML(
179
- """<div style="text-align:center"><p><small>By clicking the "Start" button above, you consent to the collection and use of your input data for research purposes.</small></p></dev>""")
180
 
181
  all_components += [human_input_textbox, btn_step, btn_restart]
182
 
@@ -251,7 +247,6 @@ Prompting multiple AI agents to play games in a language-driven environment.
251
  def step_game(all_comps: dict):
252
  yield {btn_step: gr.update(value="Running...", interactive=False),
253
  btn_restart: gr.update(interactive=False)}
254
- sleep(0.5) # control the rate of requests
255
 
256
  cur_state = all_comps[state]
257
 
@@ -382,5 +377,5 @@ Prompting multiple AI agents to play games in a language-driven environment.
382
 
383
  example_selector.change(update_components_from_example, set(all_components + [state]), all_components + [state])
384
 
385
- demo.queue(concurrency_count=32) # To improve concurrency
386
- demo.launch(debug=DEBUG)
 
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
 
101
  gr.Markdown("""# 🏟 ChatArena️<br>
102
  Prompting multiple AI agents to play games in a language-driven environment.
103
  **[Project Homepage](https://github.com/chatarena/chatarena)**""", elem_id="header")
 
104
 
105
  with gr.Row():
106
  env_selector = gr.Dropdown(choices=list(ENV_REGISTRY.keys()), value=DEFAULT_ENV, interactive=True,
 
173
  with gr.Row():
174
  btn_step = gr.Button("Start")
175
  btn_restart = gr.Button("Clear")
 
 
176
 
177
  all_components += [human_input_textbox, btn_step, btn_restart]
178
 
 
247
  def step_game(all_comps: dict):
248
  yield {btn_step: gr.update(value="Running...", interactive=False),
249
  btn_restart: gr.update(interactive=False)}
 
250
 
251
  cur_state = all_comps[state]
252
 
 
377
 
378
  example_selector.change(update_components_from_example, set(all_components + [state]), all_components + [state])
379
 
380
+ demo.queue()
381
+ demo.launch(debug=DEBUG, server_port=8080)
examples/chatgpt_claude_ai_collaboration.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "name": "AI Collaboration",
3
- "global_prompt": "",
4
- "environment": {
5
- "env_type": "conversation",
6
- "parallel": false
7
- },
8
- "players": [
9
- {
10
- "name": "ChatGPT",
11
- "role_desc": "You are ChatGPT. You are talking with Claude, another large language model created by Anthropic. You will discuss how AIs from different companies can collaboratively help making a better world for human kind. Your answer will end with <EOS>. Do not act as Claude. Your output will be shorter than 100 words.",
12
- "backend": {
13
- "backend_type": "openai-chat",
14
- "temperature": 0.7,
15
- "max_tokens": 300
16
- }
17
- },
18
- {
19
- "name": "Claude",
20
- "role_desc": "Your answer should be concise, informative and insightful. It is a group discussion in AI classroom. The goal is to discuss how AIs can collaborate for social good.",
21
- "backend": {
22
- "backend_type": "claude",
23
- "temperature": 0.7,
24
- "max_tokens": 400
25
- }
26
- }
27
- ]
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,11 +1 @@
1
- cohere>=4.1.0
2
- openai>=0.27.2
3
- gradio==3.20.0
4
- transformers>=4.0
5
- tenacity==8.2.2
6
- rich>=13.3.1
7
- prompt_toolkit>=3.0
8
- pettingzoo==1.22.3
9
- chess
10
- supabase==1.0.2
11
- chatarena==0.1.8.dev0
 
1
+ chatarena