leo19941227
commited on
Commit
β’
2bdb6ed
1
Parent(s):
c9d4907
finalize pipeline
Browse files- README.md +28 -53
- {{cookiecutter.repo_name}}/README.md +81 -33
- {{cookiecutter.repo_name}}/cli.py +22 -4
README.md
CHANGED
@@ -1,24 +1,14 @@
|
|
1 |
# SUPERB Submission Template
|
2 |
|
3 |
-
|
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
|
20 |
|
21 |
-
*
|
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
|
|
|
|
|
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://
|
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 |
-
|
102 |
|
103 |
-
|
|
|
|
|
104 |
|
105 |
-
|
106 |
-
python cli.py validate
|
107 |
-
```
|
108 |
|
109 |
-
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
All submission files validated! β¨ π β¨
|
113 |
-
Now you can make a submission π€
|
114 |
-
```
|
115 |
|
116 |
-
|
|
|
|
|
117 |
|
118 |
-
|
119 |
|
120 |
-
```
|
121 |
-
python cli.py
|
122 |
-
```
|
123 |
-
|
124 |
-
If there are no errors, you should see the following message:
|
125 |
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
```
|
130 |
|
131 |
-
|
|
|
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 |
-
|
9 |
|
10 |
-
##
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
2. Validate the model is compatible with the fine-tuning and evaluation framework
|
16 |
-
3. Push the model to the Hub!
|
17 |
|
18 |
-
|
19 |
|
20 |
-
###
|
21 |
|
22 |
-
|
23 |
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
```
|
33 |
-
|
|
|
|
|
|
|
34 |
```
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
```
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
41 |
```
|
42 |
|
43 |
-
###
|
44 |
|
45 |
-
The final step is to
|
46 |
|
47 |
-
```
|
48 |
-
|
|
|
|
|
|
|
49 |
```
|
50 |
|
51 |
-
|
52 |
|
53 |
-
```
|
54 |
-
Submission successful! π π₯³ π
|
55 |
-
Your submission will be fine-tuned and evaulated on Sunday 05 September 2021 β³
|
56 |
-
```
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 = ["
|
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(
|
51 |
subprocess.call("git pull origin main".split())
|
52 |
subprocess.call(["git", "add", "."])
|
53 |
-
subprocess.call(["git", "commit", "-m", f"Upload Upstream: {
|
54 |
subprocess.call(["git", "push"])
|
55 |
typer.echo("Upload successful!")
|
56 |
-
typer.echo("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|