leo19941227 commited on
Commit
c7d9dc5
·
1 Parent(s): 594dc64

validate downsample rate before submit

Browse files
README.md CHANGED
@@ -95,8 +95,8 @@ To make a submission to the [leaderboard](https://superbbenchmark.org/leaderboar
95
  ```python
96
  upstream = UpstreamExpert(ckpt="./model.pt")
97
  ```
98
-
99
- Note that we only install `torch` package so far by following the above steps. If your model needs more packages, you can modify the `requirement.txt` to meet your need and install them inside the current conda environment. We will install the packages you list in the `requirement.txt` before initializing the upstream model.
100
 
101
  2. Validate the upstream model's interface meets the requirements in the [challenge policy](https://superbbenchmark.org/challenge#Upstream-Specification). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
102
 
 
95
  ```python
96
  upstream = UpstreamExpert(ckpt="./model.pt")
97
  ```
98
+
99
+ ***Package Dependency:*** Note that we only install `torch` package so far by following the above steps. If your model needs more packages, you can modify the `requirement.txt` to meet your need and install them inside the current conda environment. We will install the packages you list in the `requirement.txt` before initializing the upstream model.
100
 
101
  2. Validate the upstream model's interface meets the requirements in the [challenge policy](https://superbbenchmark.org/challenge#Upstream-Specification). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
102
 
{{cookiecutter.repo_name}}/README.md CHANGED
@@ -95,8 +95,8 @@ To make a submission to the [leaderboard](https://superbbenchmark.org/leaderboar
95
  ```python
96
  upstream = UpstreamExpert(ckpt="./model.pt")
97
  ```
98
-
99
- Note that we only install `torch` package so far by following the above steps. If your model needs more packages, you can modify the `requirement.txt` to meet your need and install them inside the current conda environment. We will install the packages you list in the `requirement.txt` before initializing the upstream model.
100
 
101
  2. Validate the upstream model's interface meets the requirements in the [challenge policy](https://superbbenchmark.org/challenge#Upstream-Specification). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
102
 
 
95
  ```python
96
  upstream = UpstreamExpert(ckpt="./model.pt")
97
  ```
98
+
99
+ ***Package Dependency:*** Note that we only install `torch` package so far by following the above steps. If your model needs more packages, you can modify the `requirement.txt` to meet your need and install them inside the current conda environment. We will install the packages you list in the `requirement.txt` before initializing the upstream model.
100
 
101
  2. Validate the upstream model's interface meets the requirements in the [challenge policy](https://superbbenchmark.org/challenge#Upstream-Specification). If everything is correct, you should see the following message: "All submission files validated! Now you can make a submission."
102
 
{{cookiecutter.repo_name}}/cli.py CHANGED
@@ -20,7 +20,8 @@ def validate():
20
 
21
  try:
22
  upstream = UpstreamExpert(ckpt="model.pt")
23
- wavs = [torch.rand(round(SAMPLE_RATE * sec)) for sec in SECONDS]
 
24
  results = upstream(wavs)
25
 
26
  assert isinstance(results, dict)
@@ -34,9 +35,9 @@ def validate():
34
  assert state.dim() == 3, "(batch_size, max_sequence_length_of_batch, hidden_size)"
35
  assert state.shape == hidden_states[0].shape
36
 
37
- for task in tasks:
38
  downsample_rate = upstream.get_downsample_rates(task)
39
  assert isinstance(downsample_rate, int)
 
40
 
41
  except:
42
  print("Please check the Upstream Specification on https://superbbenchmark.org/challenge")
 
20
 
21
  try:
22
  upstream = UpstreamExpert(ckpt="model.pt")
23
+ samples = [round(SAMPLE_RATE * sec) for sec in SECONDS]
24
+ wavs = [torch.rand(sample) for sample in samples]
25
  results = upstream(wavs)
26
 
27
  assert isinstance(results, dict)
 
35
  assert state.dim() == 3, "(batch_size, max_sequence_length_of_batch, hidden_size)"
36
  assert state.shape == hidden_states[0].shape
37
 
 
38
  downsample_rate = upstream.get_downsample_rates(task)
39
  assert isinstance(downsample_rate, int)
40
+ assert abs(round(max(samples) / downsample_rate) - hidden_states[0].size(1)) < 5, "wrong downsample rate"
41
 
42
  except:
43
  print("Please check the Upstream Specification on https://superbbenchmark.org/challenge")