leo19941227 commited on
Commit
2bdb6ed
β€’
1 Parent(s): c9d4907

finalize pipeline

Browse files
README.md CHANGED
@@ -1,24 +1,14 @@
1
  # SUPERB Submission Template
2
 
3
- Welcome to the [SUPERB benchmark](https://superbbenchmark.org)! SUPERB is a collection of benchmarking resources to evaluate the capability of a universal shared representation for speech processing. SUPERB consists of the following:
4
-
5
- 1. A benchmark of ten speech processing tasks built on established public datasets
6
- 2. A benchmark toolkit designed to evaluate and analyze pretrained model performance on various downstream tasks following the conventional evaluation protocols from speech communities
7
- 3. A public leaderboard for submission and performance tracking on the benchmark
8
-
9
- SUPERB aims to offer the community a standard and comprehensive framework to train, evaluate, and compare the generalizability of universal speech representations on speech processing tasks. A universal speech representation can be leveraged to quickly adapt to diverse downstream tasks with minimum architectural change and downstream fine-tuning, so as to reduce the model development cycle time for new tasks. To emphasize on evaluating the quality of the learned universal representation, SUPERB puts an explicit constraint on the downstream model and limits its parameter size.
10
-
11
- The ultimate goal of SUPERB is to democratize the advancement in speech processing with powerful, generalizable, and reusable speech representations. SUPERB is a long-term maintained and continuously developing project. As we are gradually releasing new tasks and opening new tracks, we invite researchers to participate in the challenge and advance the research frontier together.
12
-
13
- This repository can be used to generate a template so you can submit your predictions for evaluation on [the leaderboard](https://huggingface.co/spaces/superb/superb-leaderboard).
14
 
15
  ## Quickstart
16
 
17
  ### 1. Create an account and organisation on the Hugging Face Hub
18
 
19
- First create an account on the Hugging Face Hub and you can sign up [here](https://huggingface.co/join) if you haven't already! Next, create a a new organisation for your submissions and invite the following benchmark organisers join it:
20
 
21
- * Shu-wen (Leo) Yang: [leo19941227](https://huggingface.co/leo19941227)
22
 
23
  ### 2. Create a template repository on your machine
24
 
@@ -33,7 +23,7 @@ Next, run the following commands to create the repository. We recommend creating
33
 
34
  ```bash
35
  # Create and activate a virtual environment
36
- conda create -n superb python=3.8 && conda activate superb
37
  # Install the following libraries
38
  pip install cookiecutter huggingface-hub==0.0.16
39
  # Create the template repository
@@ -62,7 +52,9 @@ my-superb-submission
62
  β”œβ”€β”€ LICENSE
63
  β”œβ”€β”€ README.md <- The README with submission instructions
64
  β”œβ”€β”€ cli.py <- The CLI for validating predictions etc
65
- └── requirements.txt <- The requirements file for the submissions
 
 
66
  ```
67
 
68
  ### 3. Install the dependencies
@@ -81,51 +73,34 @@ That's it! You're now all set to start pretraining your speech models - see the
81
 
82
  ## Submitting to the leaderboard
83
 
84
- To make a submission to the [leaderboard](https://huggingface.co/spaces/superb/superb-leaderboard)), there are three main steps:
85
-
86
- 1. Generate predictions on the unlabeled test set of each task
87
- 2. Validate the predictions are compatible with the evaluation framework
88
- 3. Push the predictions to the Hub!
89
-
90
- See the instructions below for more details.
91
-
92
- ### Rules
93
-
94
- 1. To prevent overfitting to the public leaderboard, we only evaluate **one submission per week**. You can push predictions to the Hub as many times as you wish, but we will only evaluate the most recent commit in a given week.
95
- 2. Transfer or meta-learning using other datasets, including further pre-training on other corpora, is allowed.
96
- 3. Use of unlabeled test data is allowed, as is it always available in the applied setting. For example, further pre-training using the unlabeled data for a task would be permitted.
97
- 4. Systems may be augmented with information retrieved from the internet, e.g. via automated web searches.
98
-
99
- ### Submission file format
100
 
101
- ### Validate your submission
102
 
103
- To ensure that your submission files are correctly formatted, run the following command from the root of the repository:
 
 
104
 
105
- ```
106
- python cli.py validate
107
- ```
108
 
109
- If everything is correct, you should see the following message:
 
 
110
 
111
- ```
112
- All submission files validated! ✨ πŸš€ ✨
113
- Now you can make a submission πŸ€—
114
- ```
115
 
116
- ### Push your submission to the Hugging Face Hub!
 
 
117
 
118
- The final step is to commit your files and push them to the Hub:
119
 
120
- ```
121
- python cli.py submit
122
- ```
123
-
124
- If there are no errors, you should see the following message:
125
 
126
- ```
127
- Submission successful! πŸŽ‰ πŸ₯³ πŸŽ‰
128
- Your submission will be fine-tuned and evaluated on Sunday 05 September 2021 ⏳
129
- ```
130
 
131
- where the evaluation is run every Sunday and your results will be visible on the leaderboard.
 
1
  # SUPERB Submission Template
2
 
3
+ This repository can be used to generate a template so you can submit your pretrained model for evaluation on [the leaderboard](https://huggingface.co/spaces/superb/superb-leaderboard) in the [SUPERB Challenge](https://superbbenchmark.org/challenge).
 
 
 
 
 
 
 
 
 
 
4
 
5
  ## Quickstart
6
 
7
  ### 1. Create an account and organisation on the Hugging Face Hub
8
 
9
+ First create an account on the Hugging Face Hub and you can sign up [here](https://huggingface.co/join) if you haven't already! Next, create a new organization and invite the SUPERB Hidden Set Committee to join. You will upload your model to a repository under this organization so that members inside it can access the model.
10
 
11
+ * [superb-hidden-set](https://huggingface.co/superb-hidden-set)
12
 
13
  ### 2. Create a template repository on your machine
14
 
 
23
 
24
  ```bash
25
  # Create and activate a virtual environment
26
+ conda create -n superb-submit python=3.8 && conda activate superb-submit
27
  # Install the following libraries
28
  pip install cookiecutter huggingface-hub==0.0.16
29
  # Create the template repository
 
52
  β”œβ”€β”€ LICENSE
53
  β”œβ”€β”€ README.md <- The README with submission instructions
54
  β”œβ”€β”€ cli.py <- The CLI for validating predictions etc
55
+ └── requirements.txt <- The requirements packages for the submissions
56
+ β”œβ”€β”€ expert.py <- Your model definition
57
+ └── model.pt <- Your model weights
58
  ```
59
 
60
  ### 3. Install the dependencies
 
73
 
74
  ## Submitting to the leaderboard
75
 
76
+ To make a submission to the [leaderboard](https://superbbenchmark.org/leaderboard), there are 4 main steps:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
+ 1. Modify `expert.py` and `model.py` so we can initialize an upstream model following the [policy](https://superbbenchmark.org/challenge) by:
79
 
80
+ ```python
81
+ upstream = UpstreamExpert(ckpt="./model.pt")
82
+ ```
83
 
84
+ 2. Validate the upstream model meets the requirements in the [policy](https://superbbenchmark.org/challenge). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
 
 
85
 
86
+ ```
87
+ python cli.py validate
88
+ ```
89
 
90
+ 3. Push the predictions to the Hub! If there are no errors, you should see the following message: "Upload successful!"
 
 
 
91
 
92
+ ```
93
+ python cli.py upload "commit message: my best model"
94
+ ```
95
 
96
+ 4. [Make a submission at SUPERB website](https://superbbenchmark.org/submit) by uniquely indentifying this submission/model with the following information, which will be shown by:
97
 
98
+ ```
99
+ python cli.py info
100
+ ```
 
 
101
 
102
+ - Organization Name
103
+ - Repository Name
104
+ - Commit Hash (full 40 characters)
 
105
 
106
+ After you finish the above 4 steps. Please stay tuned and wait for us to get the finetuned results on the hidden set!
{{cookiecutter.repo_name}}/README.md CHANGED
@@ -1,58 +1,106 @@
1
- ---
2
- tags:
3
- - benchmark:superb
4
- - type:model
5
- - submission_name:none
6
- ---
7
 
8
- # SUPERB submissions for test-submission-with-weights
9
 
10
- ## Submitting to the leaderboard
11
 
12
- To make a submission to the [leaderboard](https://huggingface.co/spaces/superb/superb-leaderboard)), there are three main steps:
13
 
14
- 1. Pretrain a model and store the weights in this repository as a `model.pt` file
15
- 2. Validate the model is compatible with the fine-tuning and evaluation framework
16
- 3. Push the model to the Hub!
17
 
18
- See the instructions below for more details.
19
 
20
- ### Rules
21
 
22
- 1. To prevent overfitting to the public leaderboard, we only evaluate **one submission per week**. You can push upstream models to the Hub as many times as you wish, but we will only evaluate the most recent commit in a given week.
23
 
24
- ### Submission file format
 
 
 
25
 
26
- TODO
27
 
28
- ### Validate your submission
 
 
 
 
 
 
 
29
 
30
- To ensure that your submission files are correctly formatted, run the following command from the root of the repository:
31
 
32
  ```
33
- python cli.py validate
 
 
 
34
  ```
35
 
36
- If everything is correct, you should see the following message:
 
 
 
 
 
 
37
 
38
  ```
39
- All submission files validated! ✨ πŸš€ ✨
40
- Now you can make a submission πŸ€—
 
 
 
 
 
41
  ```
42
 
43
- ### Push your submission to the Hugging Face Hub!
44
 
45
- The final step is to commit your files and push them to the Hub:
46
 
47
- ```
48
- python cli.py submit
 
 
 
49
  ```
50
 
51
- If there are no errors, you should see the following message:
52
 
53
- ```
54
- Submission successful! πŸŽ‰ πŸ₯³ πŸŽ‰
55
- Your submission will be fine-tuned and evaulated on Sunday 05 September 2021 ⏳
56
- ```
57
 
58
- and your results will be visible on the leaderboard once the model is fine-tuned and evaluated.s
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SUPERB Submission Template
 
 
 
 
 
2
 
3
+ This repository can be used to generate a template so you can submit your pretrained model for evaluation on [the leaderboard](https://huggingface.co/spaces/superb/superb-leaderboard) in the [SUPERB Challenge](https://superbbenchmark.org/challenge).
4
 
5
+ ## Quickstart
6
 
7
+ ### 1. Create an account and organisation on the Hugging Face Hub
8
 
9
+ First create an account on the Hugging Face Hub and you can sign up [here](https://huggingface.co/join) if you haven't already! Next, create a new organization and invite the SUPERB Hidden Set Committee to join. You will upload your model to a repository under this organization so that members inside it can access the model.
 
 
10
 
11
+ * [superb-hidden-set](https://huggingface.co/superb-hidden-set)
12
 
13
+ ### 2. Create a template repository on your machine
14
 
15
+ The next step is to create a template repository on your local machine that contains various files and a CLI to help you validate and submit your pretrained models. The Hugging Face Hub uses [Git Large File Storage (LFS)](https://git-lfs.github.com) to manage large files, so first install it if you don't have it already. For example, on macOS you can run:
16
 
17
+ ```bash
18
+ brew install git-lfs
19
+ git lfs install
20
+ ```
21
 
22
+ Next, run the following commands to create the repository. We recommend creating a Python virtual environment for the project, e.g. with Anaconda:
23
 
24
+ ```bash
25
+ # Create and activate a virtual environment
26
+ conda create -n superb-submit python=3.8 && conda activate superb-submit
27
+ # Install the following libraries
28
+ pip install cookiecutter huggingface-hub==0.0.16
29
+ # Create the template repository
30
+ cookiecutter git+https://huggingface.co/superb/superb-submission
31
+ ```
32
 
33
+ This will ask you to specify your Hugging Face Hub username, password, organisation, and the name of the repository:
34
 
35
  ```
36
+ hf_hub_username [<huggingface>]:
37
+ hf_hub_password [<password>]:
38
+ hf_hub_organisation [superb-submissions]:
39
+ repo_name [<my-superb-submissions>]:
40
  ```
41
 
42
+ This will trigger the following steps:
43
+
44
+ 1. Create a private dataset repository on the Hugging Face Hub under `{hf_hub_organisation}/{repo_name}`
45
+ 2. Clone the repository to your local machine
46
+ 3. Add various template files, commit them locally to the repository, and push them to the Hub
47
+
48
+ The resulting repository should have the following structure:
49
 
50
  ```
51
+ my-superb-submission
52
+ β”œβ”€β”€ LICENSE
53
+ β”œβ”€β”€ README.md <- The README with submission instructions
54
+ β”œβ”€β”€ cli.py <- The CLI for validating predictions etc
55
+ └── requirements.txt <- The requirements packages for the submissions
56
+ β”œβ”€β”€ expert.py <- Your model definition
57
+ └── model.pt <- Your model weights
58
  ```
59
 
60
+ ### 3. Install the dependencies
61
 
62
+ The final step is to install the project's dependencies:
63
 
64
+ ```bash
65
+ # Navigate to the template repository
66
+ cd my-superb-submission
67
+ # Install dependencies
68
+ python -m pip install -r requirements.txt
69
  ```
70
 
71
+ That's it! You're now all set to start pretraining your speech models - see the instructions below on how to submit them to the Hub.
72
 
 
 
 
 
73
 
74
+ ## Submitting to the leaderboard
75
+
76
+ To make a submission to the [leaderboard](https://superbbenchmark.org/leaderboard), there are 4 main steps:
77
+
78
+ 1. Modify `expert.py` and `model.py` so we can initialize an upstream model following the [policy](https://superbbenchmark.org/challenge) by:
79
+
80
+ ```python
81
+ upstream = UpstreamExpert(ckpt="./model.pt")
82
+ ```
83
+
84
+ 2. Validate the upstream model meets the requirements in the [policy](https://superbbenchmark.org/challenge). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
85
+
86
+ ```
87
+ python cli.py validate
88
+ ```
89
+
90
+ 3. Push the predictions to the Hub! If there are no errors, you should see the following message: "Upload successful!"
91
+
92
+ ```
93
+ python cli.py upload "commit message: my best model"
94
+ ```
95
+
96
+ 4. [Make a submission at SUPERB website](https://superbbenchmark.org/submit) by uniquely indentifying this submission/model with the following information, which will be shown by:
97
+
98
+ ```
99
+ python cli.py info
100
+ ```
101
+
102
+ - Organization Name
103
+ - Repository Name
104
+ - Commit Hash (full 40 characters)
105
+
106
+ After you finish the above 4 steps. Please stay tuned and wait for us to get the finetuned results on the hidden set!
{{cookiecutter.repo_name}}/cli.py CHANGED
@@ -5,7 +5,7 @@ from pathlib import Path
5
 
6
  from expert import UpstreamExpert
7
 
8
- SUBMISSION_FILES = ["README.md", "expert.py", "model.pt"]
9
  SAMPLE_RATE = 16000
10
  SECONDS = [2, 1.8, 3.7]
11
 
@@ -47,13 +47,31 @@ def validate():
47
 
48
 
49
  @app.command()
50
- def upload(submission_name: str):
51
  subprocess.call("git pull origin main".split())
52
  subprocess.call(["git", "add", "."])
53
- subprocess.call(["git", "commit", "-m", f"Upload Upstream: {submission_name} "])
54
  subprocess.call(["git", "push"])
55
  typer.echo("Upload successful!")
56
- typer.echo("Now, please go to https://superbbenchmark.org/submit to make a submission.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  if __name__ == "__main__":
59
  app()
 
5
 
6
  from expert import UpstreamExpert
7
 
8
+ SUBMISSION_FILES = ["expert.py", "model.pt"]
9
  SAMPLE_RATE = 16000
10
  SECONDS = [2, 1.8, 3.7]
11
 
 
47
 
48
 
49
  @app.command()
50
+ def upload(commit_message: str):
51
  subprocess.call("git pull origin main".split())
52
  subprocess.call(["git", "add", "."])
53
+ subprocess.call(["git", "commit", "-m", f"Upload Upstream: {commit_message} "])
54
  subprocess.call(["git", "push"])
55
  typer.echo("Upload successful!")
56
+ typer.echo("Please go to https://superbbenchmark.org/submit to make a submission with the following information:")
57
+ typer.echo("1. Organization Name")
58
+ typer.echo("2. Repository Name")
59
+ typer.echo("3. Commit Hash (full 40 characters)")
60
+ typer.echo("These information can be shown by: python cli.py info")
61
+
62
+ @app.command()
63
+ def info():
64
+ result = subprocess.run(["git", "config", "--get", "remote.origin.url"], capture_output=True)
65
+ url = result.stdout.decode("utf-8").strip()
66
+ organization = url.split("/")[-2]
67
+ repo = url.split("/")[-1]
68
+
69
+ result = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True)
70
+ commit_hash = result.stdout.decode("utf-8").strip()
71
+
72
+ typer.echo(f"Organization Name: {organization}")
73
+ typer.echo(f"Repository Name: {repo}")
74
+ typer.echo(f"Commit Hash: {commit_hash}")
75
 
76
  if __name__ == "__main__":
77
  app()