ms180 commited on
Commit
00de4b3
·
verified ·
1 Parent(s): d641d01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -19
app.py CHANGED
@@ -58,26 +58,12 @@ Please consider citing the following papers if you find our work helpful.
58
  device = "cuda" if torch.cuda.is_available() else "cpu"
59
 
60
 
61
- s2l = Speech2Language.from_pretrained(
62
- model_tag=f"espnet/owsm_v4_medium_1B",
63
- device=device,
64
- nbest=1,
65
- )
66
-
67
- # Hacking to cange config
68
- # 1. download files
69
  try:
70
- s2t_ar = ARSpeech2Text.from_pretrained(
71
- model_tag=f"espnet/owsm_v4_medium_1B",
72
- device=device,
73
- beam_size=5,
74
- ctc_weight=0.0,
75
- maxlenratio=0.0,
76
- # below are default values which can be overwritten in __call__
77
- lang_sym="<eng>",
78
- task_sym="<asr>",
79
- predict_time=False,
80
- )
81
  except Exception as e:
82
  print("File downloaded")
83
 
@@ -110,6 +96,12 @@ with open(config_path, "w") as f:
110
 
111
  print("Done! All 'gradient_checkpoint_layers' keys removed.")
112
 
 
 
 
 
 
 
113
  s2t_ar = ARSpeech2Text.from_pretrained(
114
  model_tag=f"espnet/owsm_v4_medium_1B",
115
  device=device,
 
58
  device = "cuda" if torch.cuda.is_available() else "cpu"
59
 
60
 
 
 
 
 
 
 
 
 
61
  try:
62
+ s2l = Speech2Language.from_pretrained(
63
+ model_tag=f"espnet/owsm_v4_medium_1B",
64
+ device=device,
65
+ nbest=1,
66
+ )
 
 
 
 
 
 
67
  except Exception as e:
68
  print("File downloaded")
69
 
 
96
 
97
  print("Done! All 'gradient_checkpoint_layers' keys removed.")
98
 
99
+ s2l = Speech2Language.from_pretrained(
100
+ model_tag=f"espnet/owsm_v4_medium_1B",
101
+ device=device,
102
+ nbest=1,
103
+ )
104
+
105
  s2t_ar = ARSpeech2Text.from_pretrained(
106
  model_tag=f"espnet/owsm_v4_medium_1B",
107
  device=device,