AnasPwnapple commited on
Commit
117b0c3
1 Parent(s): 24dd290

Add sorting, env vars, cleanup

Browse files
Files changed (5) hide show
  1. .gitignore +2 -0
  2. .vscode/settings.json +0 -3
  3. app.py +12 -5
  4. conf/gradio-asr.yaml +0 -28
  5. requirements.txt +1 -1
.gitignore CHANGED
@@ -1 +1,3 @@
1
  .idea
 
 
1
  .idea
2
+ .vscode
3
+ artifacts
.vscode/settings.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "python.formatting.provider": "black"
3
- }
 
 
 
app.py CHANGED
@@ -1,16 +1,22 @@
1
- import wandb
2
- import gradio as gr
3
  from datetime import datetime, timedelta
 
 
 
4
  import nemo.collections.asr as nemo_asr
 
 
 
 
 
5
 
6
- wandb_api = wandb.Api()
7
 
8
  all_artifacts_versions = [
9
  version
10
  for version in [
11
  collection.versions()
12
  for collection in wandb_api.artifact_type(
13
- type_name="model", project="nemo-experiments"
14
  ).collections()
15
  ]
16
  ]
@@ -21,10 +27,11 @@ latest_artifacts = [
21
  for artifact in artifact_versions
22
  if (
23
  datetime.fromisoformat(artifact.created_at)
24
- > datetime.now() - timedelta(days=180) # last 180 days
25
  and artifact.state != "DELETED"
26
  )
27
  ]
 
28
 
29
  models = {artifact.name: None for artifact in latest_artifacts}
30
 
 
 
1
  from datetime import datetime, timedelta
2
+ import os
3
+
4
+ import gradio as gr
5
  import nemo.collections.asr as nemo_asr
6
+ import wandb
7
+
8
+ MODEL_HISTORY_DAYS = 180
9
+ WANDB_ENTITY = os.environ.get("WANDB_ENTITY", "tarteel")
10
+ WANDB_PROJECT_NAME = os.environ.get("WANDB_PROJECT_NAME", "nemo-experiments")
11
 
12
+ wandb_api = wandb.Api(overrides={"entity": WANDB_ENTITY})
13
 
14
  all_artifacts_versions = [
15
  version
16
  for version in [
17
  collection.versions()
18
  for collection in wandb_api.artifact_type(
19
+ type_name="model", project=WANDB_PROJECT_NAME
20
  ).collections()
21
  ]
22
  ]
27
  for artifact in artifact_versions
28
  if (
29
  datetime.fromisoformat(artifact.created_at)
30
+ > datetime.now() - timedelta(days=MODEL_HISTORY_DAYS) # last 180 days
31
  and artifact.state != "DELETED"
32
  )
33
  ]
34
+ latest_artifacts.sort(key=lambda a: a.created_at, reverse=True)
35
 
36
  models = {artifact.name: None for artifact in latest_artifacts}
37
 
conf/gradio-asr.yaml DELETED
@@ -1,28 +0,0 @@
1
- sample_rate: &sample_rate 16000
2
- device: &device "cpu"
3
-
4
- gradio:
5
- source: "upload" # 'upload' or 'microphone'
6
- title: "CitriNet(Lg) Un/Diacritized Comparison"
7
-
8
- models:
9
- - _target_: "models_evaluation.models.citrinet.CitrinetTorch"
10
- cfg:
11
- model_target: "nemo.collections.asr.models.EncDecCTCModelBPE"
12
- name: "CnLg_SpeUni1024_DI_EATL600"
13
- sample_rate: *sample_rate
14
- device: *device
15
- model_path: "wandb://tarteel/nemo-experiments/CnLg_SpeUni1024_DI_EATL600:v1"
16
-
17
- - _target_: "models_evaluation.models.citrinet.CitrinetTorch"
18
- cfg:
19
- model_target: "nemo.collections.asr.models.EncDecCTCModelBPE"
20
- name: "CnLg-SpeUni256-EATL1300"
21
- sample_rate: *sample_rate
22
- device: *device
23
- model_path: "wandb://tarteel/nemo-experiments/CnLg-SpeUni256-EATL1300:v1"
24
-
25
-
26
- hydra:
27
- run:
28
- dir: ..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- nemo_toolkit[asr]==1.7.2
2
  hydra-core
3
  wandb
4
  git+https://999f33e0af91e4dcb1f83b334b9b529c9cd2a078@github.com/Tarteel-io/models_evaluation.git@main#egg=models_evaluation[nemo]
1
+ nemo_toolkit[asr]==1.10.0
2
  hydra-core
3
  wandb
4
  git+https://999f33e0af91e4dcb1f83b334b9b529c9cd2a078@github.com/Tarteel-io/models_evaluation.git@main#egg=models_evaluation[nemo]