Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,8 +40,7 @@ def write_pgn(
|
|
| 40 |
utc_time = current_utc_datetime.strftime("%H:%M:%S")
|
| 41 |
|
| 42 |
# Output the final PGN with CLKS and additional details
|
| 43 |
-
final_pgn = f"""
|
| 44 |
-
[Event 'Chess LLM Arena']
|
| 45 |
[Site 'https://github.com/mlabonne/chessllm']
|
| 46 |
[Date '{utc_date}']
|
| 47 |
[White '{model_id_white}']
|
|
@@ -106,7 +105,7 @@ def render_init(board):
|
|
| 106 |
new_width = 3 * width
|
| 107 |
|
| 108 |
# Create a new blank image with the desired dimensions
|
| 109 |
-
new_image = PILImage.new('RGB', (
|
| 110 |
|
| 111 |
# Calculate the position to paste the chess board image
|
| 112 |
left = width # One third of the width
|
|
@@ -129,7 +128,7 @@ def render_new(board):
|
|
| 129 |
new_width = 3 * width
|
| 130 |
|
| 131 |
# Create a new blank image with the desired dimensions
|
| 132 |
-
new_image = PILImage.new('RGB', (
|
| 133 |
|
| 134 |
# Calculate the position to paste the chess board image
|
| 135 |
left = width # One third of the width
|
|
@@ -451,7 +450,8 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
|
|
| 451 |
model_id_black = gr.Textbox(label="Black Model ID", value="EleutherAI/pythia-70m-deduped")
|
| 452 |
btn = gr.Button("Fight!")
|
| 453 |
with gr.Row():
|
| 454 |
-
|
|
|
|
| 455 |
btn.click(fn=update, inputs=[model_id_white, model_id_black], outputs=out)
|
| 456 |
gr.Markdown('<div align="center"><p style="font-size: 36px;">🏆 Leaderboard</p></div>')
|
| 457 |
leaderboard = gr.Dataframe(value=get_leaderboard, every=60)
|
|
|
|
| 40 |
utc_time = current_utc_datetime.strftime("%H:%M:%S")
|
| 41 |
|
| 42 |
# Output the final PGN with CLKS and additional details
|
| 43 |
+
final_pgn = f"""[Event 'Chess LLM Arena']
|
|
|
|
| 44 |
[Site 'https://github.com/mlabonne/chessllm']
|
| 45 |
[Date '{utc_date}']
|
| 46 |
[White '{model_id_white}']
|
|
|
|
| 105 |
new_width = 3 * width
|
| 106 |
|
| 107 |
# Create a new blank image with the desired dimensions
|
| 108 |
+
new_image = PILImage.new('RGB', (width, height), 'white')
|
| 109 |
|
| 110 |
# Calculate the position to paste the chess board image
|
| 111 |
left = width # One third of the width
|
|
|
|
| 128 |
new_width = 3 * width
|
| 129 |
|
| 130 |
# Create a new blank image with the desired dimensions
|
| 131 |
+
new_image = PILImage.new('RGB', (width, height), 'white')
|
| 132 |
|
| 133 |
# Calculate the position to paste the chess board image
|
| 134 |
left = width # One third of the width
|
|
|
|
| 450 |
model_id_black = gr.Textbox(label="Black Model ID", value="EleutherAI/pythia-70m-deduped")
|
| 451 |
btn = gr.Button("Fight!")
|
| 452 |
with gr.Row():
|
| 453 |
+
gr.HTML("""<div id='chessboard' style='display:block; margin-left: auto; margin-right: auto></div>""")
|
| 454 |
+
out = gr.Image(width=512, show_label=False, show_share_button=False, show_download_button=False, elem_id="chessboard")
|
| 455 |
btn.click(fn=update, inputs=[model_id_white, model_id_black], outputs=out)
|
| 456 |
gr.Markdown('<div align="center"><p style="font-size: 36px;">🏆 Leaderboard</p></div>')
|
| 457 |
leaderboard = gr.Dataframe(value=get_leaderboard, every=60)
|