HelloGitHub commited on
Commit
4615f51
·
1 Parent(s): c41e86b

update submit page

Browse files
Files changed (1) hide show
  1. app.py +24 -79
app.py CHANGED
@@ -435,90 +435,39 @@ with demo:
435
  queue=True,
436
  )
437
  gr.Markdown(EVALUATION_METRIC_TEXT, elem_classes="markdown-text")
 
 
 
 
438
  with gr.TabItem("📤 Submit Model", elem_id="submit-model-tab", id=2):
439
- gr.Markdown("## 提交模型进行评估", elem_classes="markdown-text")
440
-
441
  with gr.Row():
442
- with gr.Column(scale=1):
443
- gr.Markdown("### 1. 提交模型信息")
444
- model_name = gr.Textbox(
445
- label="Model Name",
446
- placeholder="请输入模型名称,格式:用户名/模型名",
447
- info="例如:microsoft/DialoGPT-medium"
448
- )
449
- revision_commit = gr.Textbox(
450
- label="Revision commit",
451
- placeholder="请输入版本信息,默认为 main",
452
- value="main"
453
- )
454
-
455
- # 模型信息验证按钮
456
- model_info_btn = gr.Button("验证模型信息", variant="secondary")
457
- model_info_output = gr.Textbox(label="验证结果", interactive=False)
458
-
459
- with gr.Column(scale=1):
460
- gr.Markdown("### 2. 提交API信息 (API only)")
461
- model_api_url = gr.Textbox(
462
- label="Model online api url",
463
- placeholder="请输入API URL,例如:https://api.openai.com/v1/chat/completions"
464
- )
465
- model_api_key = gr.Textbox(
466
- label="Model online api key",
467
- placeholder="请输入API密钥",
468
- type="password"
469
- )
470
- online_api_model_name = gr.Textbox(
471
- label="Online api model name",
472
- placeholder="请输入API模型名称,例如:gpt-3.5-turbo"
473
- )
474
-
475
- # API信息验证按钮
476
- api_info_btn = gr.Button("验证API信息", variant="secondary")
477
- api_info_output = gr.Textbox(label="验证结果", interactive=False)
478
 
 
 
479
  with gr.Row():
480
- with gr.Column(scale=1):
481
- gr.Markdown("### 3. 提交推理信息 (inference only)")
482
- runsh_file = gr.File(
483
- label="upload run.sh file",
484
- file_types=[".sh"],
485
- file_count="single"
486
- )
487
- adapter_file = gr.File(
488
- label="upload model_adapter.py file",
489
- file_types=[".py"],
490
- file_count="single"
491
- )
492
-
493
- # 推理信息验证按钮
494
- inference_info_btn = gr.Button("验证推理文件", variant="secondary")
495
- inference_info_output = gr.Textbox(label="验证结果", interactive=False)
496
 
 
 
497
  with gr.Row():
498
  with gr.Column():
499
- gr.Markdown("### 4. 提交评估")
500
- submit_btn = gr.Button("Submit Eval", variant="primary", size="lg")
501
- submit_output = gr.Textbox(label="提交结果", interactive=False)
502
-
503
- # 绑定事件
504
- model_info_btn.click(
505
- fn=lambda name, rev: submit_model_info(name, rev),
506
- inputs=[model_name, revision_commit],
507
- outputs=model_info_output
508
- )
509
-
510
- api_info_btn.click(
511
- fn=lambda url, key, name: submit_api_info(url, key, name),
512
- inputs=[model_api_url, model_api_key, online_api_model_name],
513
- outputs=api_info_output
514
- )
515
 
516
- inference_info_btn.click(
517
- fn=lambda runsh, adapter: submit_inference_info(runsh, adapter),
518
- inputs=[runsh_file, adapter_file],
519
- outputs=inference_info_output
520
- )
521
 
 
522
  submit_btn.click(
523
  fn=lambda name, rev, url, key, api_name, runsh, adapter: submit_eval_complete(
524
  name, rev, url, key, api_name, runsh, adapter
@@ -528,10 +477,6 @@ with demo:
528
  outputs=submit_output
529
  )
530
 
531
- with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=3):
532
- gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
533
- gr.HTML(TABLE_TEXT)
534
- gr.Markdown(LLM_BENCHMARKS_TEXT2, elem_classes="markdown-text")
535
 
536
  with gr.Row():
537
  with gr.Accordion("📙 Citation", open=False):
 
435
  queue=True,
436
  )
437
  gr.Markdown(EVALUATION_METRIC_TEXT, elem_classes="markdown-text")
438
+ with gr.TabItem("📝 About", elem_id="llm-benchmark-tab-table", id=3):
439
+ gr.Markdown(LLM_BENCHMARKS_TEXT, elem_classes="markdown-text")
440
+ gr.HTML(TABLE_TEXT)
441
+ gr.Markdown(LLM_BENCHMARKS_TEXT2, elem_classes="markdown-text")
442
  with gr.TabItem("📤 Submit Model", elem_id="submit-model-tab", id=2):
443
+ # 1. Submit your modelinfos here!
444
+ gr.Markdown("✨ Submit your modelinfos here!")
445
  with gr.Row():
446
+ model_name = gr.Textbox(label="Model Name")
447
+ revision_commit = gr.Textbox(label="Revision commit")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
448
 
449
+ # 2. Submit your API infos here! (API only)
450
+ gr.Markdown("📧 Submit your API infos here! (API only)")
451
  with gr.Row():
452
+ model_api_url = gr.Textbox(label="Model online api url")
453
+ model_api_key = gr.Textbox(label="Model online api key")
454
+ online_api_model_name = gr.Textbox(label="Online api model name")
 
 
 
 
 
 
 
 
 
 
 
 
 
455
 
456
+ # 3. Submit your inference infos here! (inference only)
457
+ gr.Markdown("📧 Submit your inference infos here! (inference only)")
458
  with gr.Row():
459
  with gr.Column():
460
+ gr.Markdown("upload run.sh file")
461
+ runsh_file = gr.File(file_types=[".sh"], file_count="single")
462
+ with gr.Column():
463
+ gr.Markdown("upload model_adapter.py file")
464
+ adapter_file = gr.File(file_types=[".py"], file_count="single")
 
 
 
 
 
 
 
 
 
 
 
465
 
466
+ # 4. Submit Eval 按钮
467
+ submit_btn = gr.Button("Submit Eval")
468
+ submit_output = gr.Textbox(label="", interactive=False, visible=False)
 
 
469
 
470
+ # 绑定事件
471
  submit_btn.click(
472
  fn=lambda name, rev, url, key, api_name, runsh, adapter: submit_eval_complete(
473
  name, rev, url, key, api_name, runsh, adapter
 
477
  outputs=submit_output
478
  )
479
 
 
 
 
 
480
 
481
  with gr.Row():
482
  with gr.Accordion("📙 Citation", open=False):