Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 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,
|