ms180 commited on
Commit
50ee433
·
verified ·
1 Parent(s): e33a5ab

Fixed config path

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -94,7 +94,15 @@ import espnet_model_zoo
94
 
95
  d = "models--espnet--owsm_v4_medium_1B/snapshots/471418ddaf0b03c9ab1fd75f1f5d26fc3aea3aa9/exp/s2t_train_conv2d8_size1024_e18_d18_mel128_raw_bpe50000/config.yaml"
96
  p = Path(espnet_model_zoo.__file__)
97
- config_path = p.parent / d
 
 
 
 
 
 
 
 
98
 
99
  def remove_key(obj, key="gradient_checkpoint_layers"):
100
  if isinstance(obj, dict):
 
94
 
95
  d = "models--espnet--owsm_v4_medium_1B/snapshots/471418ddaf0b03c9ab1fd75f1f5d26fc3aea3aa9/exp/s2t_train_conv2d8_size1024_e18_d18_mel128_raw_bpe50000/config.yaml"
96
  p = Path(espnet_model_zoo.__file__)
97
+ model_root = p / "models--espnet--owsm_v4_medium_1B" / "snapshots"
98
+
99
+ # Automatically detect the snapshot hash folder (usually only one exists)
100
+ snapshots = list(model_root.iterdir())
101
+ if not snapshots:
102
+ raise FileNotFoundError("Model snapshot not found in local cache")
103
+
104
+ snapshot = snapshots[0] # e.g., ".../471418ddaf0b03c9ab1fd75f1f5d26fc3aea3aa9"
105
+ config_path = snapshot / "exp/s2t_train_conv2d8_size1024_e18_d18_mel128_raw_bpe50000/config.yaml"
106
 
107
  def remove_key(obj, key="gradient_checkpoint_layers"):
108
  if isinstance(obj, dict):