tohid.abedini commited on
Commit
17c1bbe
·
1 Parent(s): 54fdeab

[Add] first phase of changes

Browse files
app.py CHANGED
@@ -10,6 +10,7 @@ import json
10
  import requests
11
 
12
  from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
 
13
 
14
 
15
  def fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
@@ -39,7 +40,7 @@ def fill_form(model_name, model_id, contact_email, challenge, submission_id, pap
39
 
40
  def sendForm(url, data):
41
  try:
42
- requests.post(url, data = data)
43
  print("Submitted successfully!")
44
  except:
45
  print("Error!")
@@ -99,68 +100,48 @@ def submit(model_name, model_id, contact_email, challenge, submission_id, paper_
99
  abs_path = Path(__file__).parent
100
 
101
  # Any pandas-compatible data
102
- pinder_df = pd.read_json(str(abs_path / "leaderboard_pinder.json"))
103
- plinder_df = pd.read_json(str(abs_path / "leaderboard_plinder.json"))
104
 
105
- with gr.Blocks() as demo:
106
  gr.Markdown("""
107
- # MLSB 2024 Leaderboard
108
  """)
109
 
110
 
111
- with gr.Tab("🎖️ PINDER Leaderboard"):
112
- gr.Markdown("""## PINDER Leaderboard
113
- Evaluating Protein-Protein interaction prediction
114
  """)
115
  Leaderboard(
116
- value=pinder_df,
117
  select_columns=["Arch", "Model", "L_rms", "I_rms",
118
  "F_nat", "DOCKQ", "CAPRI"],
119
  search_columns=["model_name_for_query"],
120
  hide_columns=["model_name_for_query",],
121
  filter_columns=["Arch"],
122
  )
123
- with gr.Tab("🥇 PLINDER Leaderboard"):
124
- gr.Markdown("""## PLINDER Leaderboard
125
  Evaluating Protein-Ligand prediction
126
  """)
127
  Leaderboard(
128
- value=plinder_df,
129
  select_columns=["Arch", "Model", "Mean lDDT-PLI", "Mean lDDT-LP",
130
  "Median RMSD", "% lDDT-PLI >= 0.5", "% pass PoseBusters"],
131
  search_columns=["model_name_for_query"],
132
  hide_columns=["model_name_for_query",],
133
  filter_columns=["Arch"],
134
  )
 
 
 
135
  with gr.Tab("✉️ Submit"):
136
- gr.Markdown("""## Submit your model
137
- Submit your model to the leaderboard using the below form AFTER following the following steps:
138
- - Create a HuggingFace account and request to join the [MLSB organization](https://huggingface.co/MLSB)
139
- - Create a new space in the MLSB organization and add your model using the inference templates: https://huggingface.co/new-space?owner=MLSB
140
- - Fill the submission form.
141
-
142
- ## Prerequisites:
143
- To qualify for submission, each team must:
144
- - Provide an MLSB submission ID (find it on CMT) or a link to a preprint/paper describing their methodology. This publication does not have to specifically report training or evaluation on the P(L)INDER dataset. Previously published methods, such as DiffDock, only need to link their existing paper. Note that entry into this competition does not equate to an MLSB workshop paper submission.
145
- - Create a copy of the provided [inference templates](https://huggingface.co/MLSB/).
146
- - Go to the top right corner of the page of the respective inference template and click on the drop-down menu (vertical ellipsis) right next to the “Community”, then select “Duplicate this space”.
147
- - Change files in the newly create space to reflect the peculiarities of your model
148
- - Edit `requirements.txt` to capture all python dependencies.
149
- - Modify the Dockerfile as appropriate (including selecting the right base image)
150
- - Include a `inference_app.py` file. This contains a `predict` function that should be modified to reflect the specifics of inference using their model.
151
- - Include a `train.py` file to ensure that training and model selection use only the PINDER/PLINDER datasets and to clearly show any additional hyperparameters used.
152
- - Provide a LICENSE file that allows for reuse, derivative works, and distribution of the provided software and weights (e.g., MIT or Apache2 license).
153
- - Submit to the leaderboard via the [form below](https://huggingface.co/spaces/MLSB/leaderboard2024).
154
- - On submission page, add reference to the newly created space in the format username/space (e.g mlsb/alphafold3). You can create the space on your personal Huggingface account and transfer it to MLSB for the submission to get a GPU assigned.
155
-
156
- After a brief technical review by our organizers we will grant you a free GPU until MLSB so that anyone can play with the model and we will run the evaluation.
157
-
158
- If you have a questions please email: [email protected]
159
- """)
160
  model_name = gr.Textbox(label="Model name")
161
  model_id = gr.Textbox(label="username/space e.g mlsb/alphafold3")
162
  contact_email = gr.Textbox(label="Contact E-Mail")
163
- challenge = gr.Radio(choices=["PINDER", "PLINDER"],label="Challenge")
164
  gr.Markdown("Either give a submission id if you submitted to the MLSB workshop or provide a link to the preprint/paper describing the method.")
165
  with gr.Row():
166
  submission_id = gr.Textbox(label="Submission ID on CMT")
 
10
  import requests
11
 
12
  from envs import API, EVAL_REQUESTS_PATH, TOKEN, QUEUE_REPO
13
+ from utils import LLM_BENCHMARKS_ABOUT_TEXT, LLM_BENCHMARKS_SUBMIT_TEXT, custom_css
14
 
15
 
16
  def fill_form(model_name, model_id, contact_email, challenge, submission_id, paper_link, architecture, license):
 
40
 
41
  def sendForm(url, data):
42
  try:
43
+ requests.post(url, data=data)
44
  print("Submitted successfully!")
45
  except:
46
  print("Error!")
 
100
  abs_path = Path(__file__).parent
101
 
102
  # Any pandas-compatible data
103
+ persian_df = pd.read_json(str(abs_path / "leaderboard_persian.json"))
104
+ base_df = pd.read_json(str(abs_path / "leaderboard_base.json"))
105
 
106
+ with gr.Blocks(css=custom_css) as demo:
107
  gr.Markdown("""
108
+ # Part LLM Leaderboard
109
  """)
110
 
111
 
112
+ with gr.Tab("🎖️ Persian Leaderboard"):
113
+ gr.Markdown("""## Persian LLM Leaderboard
114
+ Evaluating Persian Fine-Tuned models
115
  """)
116
  Leaderboard(
117
+ value=persian_df,
118
  select_columns=["Arch", "Model", "L_rms", "I_rms",
119
  "F_nat", "DOCKQ", "CAPRI"],
120
  search_columns=["model_name_for_query"],
121
  hide_columns=["model_name_for_query",],
122
  filter_columns=["Arch"],
123
  )
124
+ with gr.Tab("🥇 Base Leaderboard"):
125
+ gr.Markdown("""## Base Leaderboard
126
  Evaluating Protein-Ligand prediction
127
  """)
128
  Leaderboard(
129
+ value=base_df,
130
  select_columns=["Arch", "Model", "Mean lDDT-PLI", "Mean lDDT-LP",
131
  "Median RMSD", "% lDDT-PLI >= 0.5", "% pass PoseBusters"],
132
  search_columns=["model_name_for_query"],
133
  hide_columns=["model_name_for_query",],
134
  filter_columns=["Arch"],
135
  )
136
+ with gr.TabItem("📝 About"):
137
+ gr.Markdown(LLM_BENCHMARKS_ABOUT_TEXT)
138
+
139
  with gr.Tab("✉️ Submit"):
140
+ gr.Markdown(LLM_BENCHMARKS_SUBMIT_TEXT)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  model_name = gr.Textbox(label="Model name")
142
  model_id = gr.Textbox(label="username/space e.g mlsb/alphafold3")
143
  contact_email = gr.Textbox(label="Contact E-Mail")
144
+ challenge = gr.Radio(choices=["Persian", "Base"],label="Challenge")
145
  gr.Markdown("Either give a submission id if you submitted to the MLSB workshop or provide a link to the preprint/paper describing the method.")
146
  with gr.Row():
147
  submission_id = gr.Textbox(label="Submission ID on CMT")
envs.py CHANGED
@@ -6,12 +6,12 @@ from huggingface_hub import HfApi
6
  # ----------------------------------
7
  TOKEN = os.environ.get("HF_TOKEN") # A read/write token for your org
8
 
9
- OWNER = "MLSB" # Change to your org - don't forget to create a results and request dataset, with the correct format!
10
  # ----------------------------------
11
 
12
- REPO_ID = f"{OWNER}/leaderboard2024"
13
- QUEUE_REPO = f"{OWNER}/requests"
14
- RESULTS_REPO = f"{OWNER}/results"
15
 
16
  # If you setup a cache later, just change HF_HOME
17
  CACHE_PATH=os.getenv("HF_HOME", ".")
 
6
  # ----------------------------------
7
  TOKEN = os.environ.get("HF_TOKEN") # A read/write token for your org
8
 
9
+ OWNER = "PartAI" # Change to your org - don't forget to create a results and request dataset, with the correct format!
10
  # ----------------------------------
11
 
12
+ REPO_ID = f"{OWNER}/llm-leaderboard-2"
13
+ QUEUE_REPO = f"{OWNER}/leaderboard-requests"
14
+ RESULTS_REPO = f"{OWNER}/leaderboard-results"
15
 
16
  # If you setup a cache later, just change HF_HOME
17
  CACHE_PATH=os.getenv("HF_HOME", ".")
leaderboard_plinder.json → leaderboard_base.json RENAMED
File without changes
leaderboard_pinder.json → leaderboard_persian.json RENAMED
File without changes
utils.py ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ custom_css = """
2
+ @import url('https://fonts.googleapis.com/css2?family=Vazirmatn&display=swap');
3
+ body, .gradio-container, .gr-button, .gr-input, .gr-slider, .gr-dropdown, .gr-markdown {
4
+ font-family: 'Vazirmatn', sans-serif !important;
5
+ }
6
+
7
+ .markdown-text {
8
+ font-size: 16px !important;
9
+ }
10
+
11
+ #models-to-add-text {
12
+ font-size: 18px !important;
13
+ }
14
+
15
+ #citation-button span {
16
+ font-size: 16px !important;
17
+ }
18
+
19
+ #citation-button textarea {
20
+ font-size: 16px !important;
21
+ }
22
+
23
+ #citation-button > label > button {
24
+ margin: 6px;
25
+ transform: scale(1.3);
26
+ }
27
+
28
+ #leaderboard-table {
29
+ margin-top: 15px
30
+ }
31
+
32
+ #leaderboard-table-lite {
33
+ margin-top: 15px
34
+ }
35
+
36
+ #search-bar-table-box > div:first-child {
37
+ background: none;
38
+ border: none;
39
+ }
40
+
41
+ #search-bar {
42
+ padding: 0px;
43
+ }
44
+
45
+ /* Limit the width of the first AutoEvalColumn so that names don't expand too much */
46
+ #leaderboard-table td:nth-child(2),
47
+ #leaderboard-table th:nth-child(2) {
48
+ max-width: 400px;
49
+ overflow: auto;
50
+ white-space: nowrap;
51
+ }
52
+
53
+ .tab-buttons button {
54
+ font-size: 20px;
55
+ }
56
+
57
+ #scale-logo {
58
+ border-style: none !important;
59
+ box-shadow: none;
60
+ display: block;
61
+ margin-left: auto;
62
+ margin-right: auto;
63
+ max-width: 600px;
64
+ }
65
+
66
+ #scale-logo .download {
67
+ display: none;
68
+ }
69
+ #filter_type{
70
+ border: 0;
71
+ padding-left: 0;
72
+ padding-top: 0;
73
+ }
74
+ #filter_type label {
75
+ display: flex;
76
+ }
77
+ #filter_type label > span{
78
+ margin-top: var(--spacing-lg);
79
+ margin-right: 0.5em;
80
+ }
81
+ #filter_type label > .wrap{
82
+ width: 103px;
83
+ }
84
+ #filter_type label > .wrap .wrap-inner{
85
+ padding: 2px;
86
+ }
87
+ #filter_type label > .wrap .wrap-inner input{
88
+ width: 1px
89
+ }
90
+ #filter-columns-type{
91
+ border:0;
92
+ padding:0.5;
93
+ }
94
+ #filter-columns-size{
95
+ border:0;
96
+ padding:0.5;
97
+ }
98
+ #box-filter > .form{
99
+ border: 0
100
+ }
101
+ """
102
+
103
+ LLM_BENCHMARKS_ABOUT_TEXT = f"""
104
+ ## How it works
105
+
106
+ ## Reproducibility
107
+ To reproduce our results, here is the commands you can run:
108
+
109
+ """
110
+
111
+
112
+ LLM_BENCHMARKS_SUBMIT_TEXT = """## Submit your model
113
+ Submit your model to the leaderboard using the below form AFTER following the following steps:
114
+ - Create a HuggingFace account and request to join the [MLSB organization](https://huggingface.co/MLSB)
115
+ - Create a new space in the MLSB organization and add your model using the inference templates: https://huggingface.co/new-space?owner=MLSB
116
+ - Fill the submission form.
117
+
118
+ ## Prerequisites:
119
+ To qualify for submission, each team must:
120
+ - Provide an MLSB submission ID (find it on CMT) or a link to a preprint/paper describing their methodology. This publication does not have to specifically report training or evaluation on the P(L)INDER dataset. Previously published methods, such as DiffDock, only need to link their existing paper. Note that entry into this competition does not equate to an MLSB workshop paper submission.
121
+ - Create a copy of the provided [inference templates](https://huggingface.co/MLSB/).
122
+ - Go to the top right corner of the page of the respective inference template and click on the drop-down menu (vertical ellipsis) right next to the “Community”, then select “Duplicate this space”.
123
+ - Change files in the newly create space to reflect the peculiarities of your model
124
+ - Edit `requirements.txt` to capture all python dependencies.
125
+ - Modify the Dockerfile as appropriate (including selecting the right base image)
126
+ - Include a `inference_app.py` file. This contains a `predict` function that should be modified to reflect the specifics of inference using their model.
127
+ - Include a `train.py` file to ensure that training and model selection use only the Persian/Base datasets and to clearly show any additional hyperparameters used.
128
+ - Provide a LICENSE file that allows for reuse, derivative works, and distribution of the provided software and weights (e.g., MIT or Apache2 license).
129
+ - Submit to the leaderboard via the [form below](https://huggingface.co/spaces/MLSB/leaderboard2024).
130
+ - On submission page, add reference to the newly created space in the format username/space (e.g mlsb/alphafold3). You can create the space on your personal Huggingface account and transfer it to MLSB for the submission to get a GPU assigned.
131
+
132
+ After a brief technical review by our organizers we will grant you a free GPU until MLSB so that anyone can play with the model and we will run the evaluation.
133
+
134
+ If you have a questions please email: [email protected]
135
+ """