loodvanniekerkginkgo commited on
Commit
58db0a0
·
1 Parent(s): d4cc92c

Removing old sterralator code, removed extra print statement

Browse files
Files changed (4) hide show
  1. about.py +5 -4
  2. eval.py +0 -0
  3. evaluation.py +0 -28
  4. utils.py +2 -73
about.py CHANGED
@@ -12,9 +12,9 @@ Here we show 5 of these properties and invite the community to submit and develo
12
  **How to submit?**
13
 
14
  1. Download the [GDPa1 dataset](https://huggingface.co/datasets/ginkgo-datapoints/GDPa1)
15
- 2. Make predictions for all the antibody sequences in the list for your property of interest.
16
- 3. Submit a CSV file containing the `"antibody_name"` column and a column per property you are predicting (e.g. `"antibody_name,Titer"` if you are predicting Titer).
17
- There is an example submission filename on the "✉️ Submit" tab.
18
 
19
  For the cross-validation metrics (if training only on the GDPa1 dataset), use the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column to split the dataset into folds and make predictions for each of the folds.
20
  Submit a CSV file in the same format but also containing the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column.
@@ -29,9 +29,10 @@ For the heldout private set, we will calculate these results privately at the en
29
  **How to contribute?**
30
 
31
  We'd like to add some more existing models to the leaderboard. Some examples of models we'd like to add:
32
- - ESM embeddings
33
  - Absolute folding stability models
34
  - AbLEF
 
35
  If you would like to collaborate with others, start a discussion on the "Community" tab at the top of this page.
36
 
37
  ### FAQs
 
12
  **How to submit?**
13
 
14
  1. Download the [GDPa1 dataset](https://huggingface.co/datasets/ginkgo-datapoints/GDPa1)
15
+ 2. Make predictions for all the antibody sequences for your property of interest.
16
+ 3. Submit a CSV file containing the `"antibody_name"` column and a column matching the property name you are predicting (e.g. `"antibody_name,Titer"` if you are predicting Titer).
17
+ There is an example submission file on the "✉️ Submit" tab.
18
 
19
  For the cross-validation metrics (if training only on the GDPa1 dataset), use the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column to split the dataset into folds and make predictions for each of the folds.
20
  Submit a CSV file in the same format but also containing the `"hierarchical_cluster_IgG_isotype_stratified_fold"` column.
 
29
  **How to contribute?**
30
 
31
  We'd like to add some more existing models to the leaderboard. Some examples of models we'd like to add:
32
+ - ESM embeddings + ridge regression
33
  - Absolute folding stability models
34
  - AbLEF
35
+
36
  If you would like to collaborate with others, start a discussion on the "Community" tab at the top of this page.
37
 
38
  ### FAQs
eval.py DELETED
File without changes
evaluation.py DELETED
@@ -1,28 +0,0 @@
1
- def evaluate_problem(
2
- problem_type: str,
3
- input_file: str,
4
- # ) -> problems.EvaluationSingleObjective | problems.EvaluationMultiObjective:
5
- ):
6
- pass
7
- # with Path(input_file).open("r") as f:
8
- # raw = f.read()
9
- # data_dict = json.loads(raw)
10
- # data = data_dict['boundary_json']
11
-
12
- # print("Starting evaluation.")
13
-
14
- # match problem_type:
15
- # case "geometrical":
16
- # boundary = load_boundary(data)
17
- # result = problems.GeometricalProblem().evaluate(boundary)
18
- # case "simple_to_build":
19
- # boundary = load_boundary(data)
20
- # result = problems.SimpleToBuildQIStellarator().evaluate(boundary)
21
- # case "mhd_stable":
22
- # boundaries = load_boundaries(data)
23
- # result = problems.MHDStableQIStellarator().evaluate(boundaries)
24
- # case _:
25
- # raise ValueError(f"Unknown problem type: {problem_type}")
26
-
27
- # print("Finished evaluation.")
28
- # return result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
utils.py CHANGED
@@ -1,24 +1,11 @@
1
- import pathlib
2
- import tempfile
3
- import json
4
-
5
- import gradio as gr
6
  import pandas as pd
7
  from datasets import load_dataset
8
- from huggingface_hub import hf_hub_download
9
 
10
- from constants import API, SUBMISSIONS_REPO, RESULTS_REPO, ASSAY_RENAME, LEADERBOARD_RESULTS_COLUMNS
11
 
12
  pd.set_option('display.max_columns', None)
13
 
14
- # def make_user_clickable(name):
15
- # link =f'https://huggingface.co/{name}'
16
- # return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{name}</a>'
17
-
18
- # def make_boundary_clickable(filename):
19
- # link =f'https://huggingface.co/datasets/proxima-fusion/constellaration-bench-results/blob/main/{filename}'
20
- # return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">link</a>'
21
-
22
 
23
  def show_output_box(message):
24
  return gr.update(value=message, visible=True)
@@ -33,62 +20,4 @@ def fetch_hf_results():
33
  # Show latest submission only
34
  df = df.sort_values("submission_time", ascending=False).drop_duplicates(subset=["model", "assay"], keep="first")
35
  df["property"] = df["assay"].map(ASSAY_RENAME)
36
- print(df.head())
37
  return df
38
-
39
-
40
- def read_result_from_hub(filename):
41
- local_path = hf_hub_download(
42
- repo_id=RESULTS_REPO,
43
- repo_type="dataset",
44
- filename=filename,
45
- )
46
- return local_path
47
-
48
-
49
- def read_submission_from_hub(filename):
50
- local_path = hf_hub_download(
51
- repo_id=SUBMISSIONS_REPO,
52
- repo_type="dataset",
53
- filename=filename,
54
- )
55
- return local_path
56
-
57
-
58
- def write_results(record, result):
59
- record.update(result)
60
- record["result_filename"] = (
61
- record["submission_filename"].rstrip(".json") + "_results.json"
62
- )
63
- print(record["result_filename"])
64
- record["evaluated"] = True
65
-
66
- record["objectives"] = json.dumps(record.get("objectives", []))
67
- record["feasibilities"] = json.dumps(record.get("feasibility", []))
68
-
69
- if "objective" not in record.keys():
70
- record["objective"] = 0.0
71
- record["minimize_objective"] = True
72
- record["feasibility"] = sum(record["feasibility"]) / len(record["feasibility"])
73
-
74
- with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as tmp:
75
- json.dump(record, tmp, indent=2)
76
- tmp.flush()
77
- tmp_name = tmp.name
78
-
79
- API.upload_file(
80
- path_or_fileobj=tmp_name,
81
- path_in_repo=record["result_filename"],
82
- repo_id=RESULTS_REPO,
83
- repo_type="dataset",
84
- commit_message=f"Add result data for {record['result_filename']}",
85
- )
86
-
87
- pathlib.Path(tmp_name).unlink()
88
- return
89
-
90
-
91
- def get_user(profile: gr.OAuthProfile | None) -> str:
92
- if profile is None:
93
- return "Please login to submit a boundary for evaluation."
94
- return profile.username
 
 
 
 
 
 
1
  import pandas as pd
2
  from datasets import load_dataset
3
+ import gradio as gr
4
 
5
+ from constants import RESULTS_REPO, ASSAY_RENAME, LEADERBOARD_RESULTS_COLUMNS
6
 
7
  pd.set_option('display.max_columns', None)
8
 
 
 
 
 
 
 
 
 
9
 
10
  def show_output_box(message):
11
  return gr.update(value=message, visible=True)
 
20
  # Show latest submission only
21
  df = df.sort_values("submission_time", ascending=False).drop_duplicates(subset=["model", "assay"], keep="first")
22
  df["property"] = df["assay"].map(ASSAY_RENAME)
 
23
  return df