Spaces:
Runtime error
Runtime error
huppress httpx logging
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ import requests
|
|
20 |
from datasets import load_dataset
|
21 |
|
22 |
logging.basicConfig(level=os.getenv("LOG_LEVEL", "INFO"))
|
|
|
23 |
|
24 |
# Create a DynamoDB client
|
25 |
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
|
@@ -310,7 +311,7 @@ with gr.Blocks() as arena:
|
|
310 |
with gr.Row():
|
311 |
arena_submit = gr.Button(value="Send message", variant="secondary").style(full_width=True)
|
312 |
arena_clear = gr.Button(value="New topic", variant="secondary").style(full_width=False)
|
313 |
-
|
314 |
|
315 |
arena_clear.click(lambda: None, None, arena_chatbot1, queue=False)
|
316 |
arena_clear.click(lambda: None, None, arena_chatbot2, queue=False)
|
@@ -327,7 +328,7 @@ with gr.Blocks() as arena:
|
|
327 |
).then(
|
328 |
fn=user, inputs=[arena_message, arena_nudge_msg, arena_chatbot1, arena_chatbot2], outputs=[arena_message, arena_nudge_msg, arena_chatbot1, arena_chatbot2], queue=True
|
329 |
).then(
|
330 |
-
fn=chat, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg], outputs=[arena_chatbot1, arena_chatbot2, arena_message, reveal1, reveal2,
|
331 |
).then(
|
332 |
lambda *args: (
|
333 |
gr.update(visible=False, interactive=False),
|
@@ -342,7 +343,7 @@ with gr.Blocks() as arena:
|
|
342 |
)
|
343 |
|
344 |
choose1_click_event = choose1.click(
|
345 |
-
fn=chosen_one_first, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona,
|
346 |
).then(
|
347 |
lambda *args: (
|
348 |
gr.update(visible=False),
|
@@ -357,7 +358,7 @@ with gr.Blocks() as arena:
|
|
357 |
)
|
358 |
|
359 |
choose2_click_event = choose2.click(
|
360 |
-
fn=chosen_one_second, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona,
|
361 |
).then(
|
362 |
lambda *args: (
|
363 |
gr.update(visible=False),
|
@@ -372,7 +373,7 @@ with gr.Blocks() as arena:
|
|
372 |
)
|
373 |
|
374 |
choose3_click_event = choose3.click(
|
375 |
-
fn=chosen_one_tie, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona,
|
376 |
).then(
|
377 |
lambda *args: (
|
378 |
gr.update(visible=False),
|
@@ -387,7 +388,7 @@ with gr.Blocks() as arena:
|
|
387 |
)
|
388 |
|
389 |
choose4_click_event = choose4.click(
|
390 |
-
fn=chosen_one_suck, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona,
|
391 |
).then(
|
392 |
lambda *args: (
|
393 |
gr.update(visible=False),
|
|
|
20 |
from datasets import load_dataset
|
21 |
|
22 |
logging.basicConfig(level=os.getenv("LOG_LEVEL", "INFO"))
|
23 |
+
logging.getLogger("httpx").setLevel(logging.WARNING)
|
24 |
|
25 |
# Create a DynamoDB client
|
26 |
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
|
|
|
311 |
with gr.Row():
|
312 |
arena_submit = gr.Button(value="Send message", variant="secondary").style(full_width=True)
|
313 |
arena_clear = gr.Button(value="New topic", variant="secondary").style(full_width=False)
|
314 |
+
arena_state = gr.State({})
|
315 |
|
316 |
arena_clear.click(lambda: None, None, arena_chatbot1, queue=False)
|
317 |
arena_clear.click(lambda: None, None, arena_chatbot2, queue=False)
|
|
|
328 |
).then(
|
329 |
fn=user, inputs=[arena_message, arena_nudge_msg, arena_chatbot1, arena_chatbot2], outputs=[arena_message, arena_nudge_msg, arena_chatbot1, arena_chatbot2], queue=True
|
330 |
).then(
|
331 |
+
fn=chat, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg], outputs=[arena_chatbot1, arena_chatbot2, arena_message, reveal1, reveal2, arena_state], queue=True
|
332 |
).then(
|
333 |
lambda *args: (
|
334 |
gr.update(visible=False, interactive=False),
|
|
|
343 |
)
|
344 |
|
345 |
choose1_click_event = choose1.click(
|
346 |
+
fn=chosen_one_first, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona, arena_state], outputs=[], queue=True
|
347 |
).then(
|
348 |
lambda *args: (
|
349 |
gr.update(visible=False),
|
|
|
358 |
)
|
359 |
|
360 |
choose2_click_event = choose2.click(
|
361 |
+
fn=chosen_one_second, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona, arena_state], outputs=[], queue=True
|
362 |
).then(
|
363 |
lambda *args: (
|
364 |
gr.update(visible=False),
|
|
|
373 |
)
|
374 |
|
375 |
choose3_click_event = choose3.click(
|
376 |
+
fn=chosen_one_tie, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona, arena_state], outputs=[], queue=True
|
377 |
).then(
|
378 |
lambda *args: (
|
379 |
gr.update(visible=False),
|
|
|
388 |
)
|
389 |
|
390 |
choose4_click_event = choose4.click(
|
391 |
+
fn=chosen_one_suck, inputs=[arena_chatbot1, arena_chatbot2, arena_system_msg, arena_nudge_msg, arena_rlhf_persona, arena_state], outputs=[], queue=True
|
392 |
).then(
|
393 |
lambda *args: (
|
394 |
gr.update(visible=False),
|