Spaces:
Running
on
Zero
Running
on
Zero
kevinwang676
commited on
Commit
•
1eca4d1
1
Parent(s):
4a1fed3
Update app.py
Browse files
app.py
CHANGED
@@ -121,21 +121,12 @@ convert_now("10.wav", "test", converter_test)
|
|
121 |
'''
|
122 |
|
123 |
@spaces.GPU()
|
124 |
-
def
|
125 |
global hubert_model
|
126 |
from fairseq import checkpoint_utils
|
127 |
|
128 |
-
if hubert_path is None:
|
129 |
-
hubert_path = ""
|
130 |
-
if not os.path.exists(hubert_path):
|
131 |
-
for id_model in BASE_MODELS:
|
132 |
-
download_manager(
|
133 |
-
os.path.join(BASE_DOWNLOAD_LINK, id_model), BASE_DIR
|
134 |
-
)
|
135 |
-
hubert_path = "hubert_base.pt"
|
136 |
-
|
137 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
138 |
-
[
|
139 |
suffix="",
|
140 |
)
|
141 |
hubert_model = models[0]
|
@@ -145,11 +136,8 @@ def load_hu_bert(config, hubert_path=None):
|
|
145 |
else:
|
146 |
hubert_model = hubert_model.float()
|
147 |
hubert_model.eval()
|
148 |
-
print(hubert_model)
|
149 |
-
|
150 |
-
return hubert_model
|
151 |
|
152 |
-
|
153 |
|
154 |
def get_file_name(url):
|
155 |
match = re.search(pattern_zip, url)
|
|
|
121 |
'''
|
122 |
|
123 |
@spaces.GPU()
|
124 |
+
def load_hubert():
|
125 |
global hubert_model
|
126 |
from fairseq import checkpoint_utils
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
models, _, _ = checkpoint_utils.load_model_ensemble_and_task(
|
129 |
+
["hubert_base.pt"],
|
130 |
suffix="",
|
131 |
)
|
132 |
hubert_model = models[0]
|
|
|
136 |
else:
|
137 |
hubert_model = hubert_model.float()
|
138 |
hubert_model.eval()
|
|
|
|
|
|
|
139 |
|
140 |
+
load_hubert()
|
141 |
|
142 |
def get_file_name(url):
|
143 |
match = re.search(pattern_zip, url)
|