Spaces:
Sleeping
Sleeping
add data
Browse files
main.py
CHANGED
|
@@ -12,6 +12,15 @@ docker run -itd \
|
|
| 12 |
-e port=7862 \
|
| 13 |
llm_eval_system:v20250724_1442 \
|
| 14 |
/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"""
|
| 16 |
import argparse
|
| 17 |
import json
|
|
@@ -70,16 +79,16 @@ css = """
|
|
| 70 |
max-width: 500px !important; /* 第二列 */
|
| 71 |
}
|
| 72 |
#view_chat_df th:nth-child(3), #view_chat_df td:nth-child(3) {
|
| 73 |
-
max-width:
|
| 74 |
}
|
| 75 |
#view_chat_df th:nth-child(4), #view_chat_df td:nth-child(4) {
|
| 76 |
-
max-width:
|
| 77 |
}
|
| 78 |
#view_chat_df th:nth-child(5), #view_chat_df td:nth-child(5) {
|
| 79 |
-
max-width:
|
| 80 |
}
|
| 81 |
#view_chat_df th:nth-child(6), #view_chat_df td:nth-child(6) {
|
| 82 |
-
max-width:
|
| 83 |
}
|
| 84 |
"""
|
| 85 |
|
|
@@ -262,6 +271,16 @@ def main():
|
|
| 262 |
|
| 263 |
llm_ranking_board = when_click_board_button(board_columns_choices_default_value)
|
| 264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
# ui
|
| 266 |
with gr.Blocks(css=css) as blocks:
|
| 267 |
with gr.Tabs():
|
|
@@ -272,7 +291,7 @@ def main():
|
|
| 272 |
label="columns"
|
| 273 |
)
|
| 274 |
board_button = gr.Button(value="View", variant="primary", visible=True)
|
| 275 |
-
board_board = gr.DataFrame(value=llm_ranking_board, max_height=
|
| 276 |
|
| 277 |
board_button.click(
|
| 278 |
fn=when_click_board_button,
|
|
@@ -303,7 +322,15 @@ def main():
|
|
| 303 |
_ = get_fs_tab()
|
| 304 |
_ = get_shell_tab()
|
| 305 |
with gr.TabItem("view_chat"):
|
| 306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
with gr.Row():
|
| 308 |
view_chat_button = gr.Button(value="View", variant="primary", visible=True)
|
| 309 |
view_chat_df = gr.DataFrame(
|
|
|
|
| 12 |
-e port=7862 \
|
| 13 |
llm_eval_system:v20250724_1442 \
|
| 14 |
/bin/bash
|
| 15 |
+
|
| 16 |
+
docker run -itd \
|
| 17 |
+
--name llm_eval_system_7862 \
|
| 18 |
+
--restart=always \
|
| 19 |
+
--network host \
|
| 20 |
+
python:3.12 \
|
| 21 |
+
/bin/bash
|
| 22 |
+
|
| 23 |
+
nohup python3 main.py --server_port 7862 &
|
| 24 |
"""
|
| 25 |
import argparse
|
| 26 |
import json
|
|
|
|
| 79 |
max-width: 500px !important; /* 第二列 */
|
| 80 |
}
|
| 81 |
#view_chat_df th:nth-child(3), #view_chat_df td:nth-child(3) {
|
| 82 |
+
max-width: 400px !important; /* 第三列 */
|
| 83 |
}
|
| 84 |
#view_chat_df th:nth-child(4), #view_chat_df td:nth-child(4) {
|
| 85 |
+
max-width: 400px !important; /* 第四列 */
|
| 86 |
}
|
| 87 |
#view_chat_df th:nth-child(5), #view_chat_df td:nth-child(5) {
|
| 88 |
+
max-width: 400px !important; /* 第五列 */
|
| 89 |
}
|
| 90 |
#view_chat_df th:nth-child(6), #view_chat_df td:nth-child(6) {
|
| 91 |
+
max-width: 80px !important; /* 第六列 */
|
| 92 |
}
|
| 93 |
"""
|
| 94 |
|
|
|
|
| 271 |
|
| 272 |
llm_ranking_board = when_click_board_button(board_columns_choices_default_value)
|
| 273 |
|
| 274 |
+
# chat
|
| 275 |
+
chat_eval_data_examples = list()
|
| 276 |
+
for filename in eval_data_dir.glob("**/*-chat.jsonl"):
|
| 277 |
+
dataset = filename.parts[-1]
|
| 278 |
+
model_name = filename.parts[-5]
|
| 279 |
+
company = filename.parts[-6]
|
| 280 |
+
chat_eval_data_examples.append([
|
| 281 |
+
company, model_name, dataset, filename.as_posix()
|
| 282 |
+
])
|
| 283 |
+
|
| 284 |
# ui
|
| 285 |
with gr.Blocks(css=css) as blocks:
|
| 286 |
with gr.Tabs():
|
|
|
|
| 291 |
label="columns"
|
| 292 |
)
|
| 293 |
board_button = gr.Button(value="View", variant="primary", visible=True)
|
| 294 |
+
board_board = gr.DataFrame(value=llm_ranking_board, max_height=800, min_width=160, label="board", show_search="search")
|
| 295 |
|
| 296 |
board_button.click(
|
| 297 |
fn=when_click_board_button,
|
|
|
|
| 322 |
_ = get_fs_tab()
|
| 323 |
_ = get_shell_tab()
|
| 324 |
with gr.TabItem("view_chat"):
|
| 325 |
+
view_chat_company = gr.Textbox(label="company", visible=False)
|
| 326 |
+
view_chat_model_name = gr.Textbox(label="model_name", visible=False)
|
| 327 |
+
view_chat_dataset = gr.Textbox(label="dataset", visible=False)
|
| 328 |
+
view_chat_filename = gr.Textbox(label="filename", visible=True)
|
| 329 |
+
gr.Examples(
|
| 330 |
+
examples=chat_eval_data_examples,
|
| 331 |
+
inputs=[view_chat_company, view_chat_model_name, view_chat_dataset, view_chat_filename],
|
| 332 |
+
outputs=None,
|
| 333 |
+
)
|
| 334 |
with gr.Row():
|
| 335 |
view_chat_button = gr.Button(value="View", variant="primary", visible=True)
|
| 336 |
view_chat_df = gr.DataFrame(
|