Spaces:
Running
on
Zero
Running
on
Zero
StevenChen16
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -15,15 +15,17 @@ MODEL_NAME = "large-v3"
|
|
15 |
YT_LENGTH_LIMIT_S = 3600 # 1 hour YouTube files
|
16 |
|
17 |
# 加载WhisperX模型
|
18 |
-
@spaces.GPU
|
19 |
-
def load_whisperx_model():
|
20 |
-
|
21 |
return whisperx.load_model(MODEL_NAME, device=device, compute_type=compute_type)
|
22 |
|
23 |
-
model = load_whisperx_model()
|
24 |
|
25 |
@spaces.GPU
|
26 |
def transcribe(inputs, task):
|
|
|
|
|
27 |
if inputs is None:
|
28 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
29 |
|
|
|
15 |
YT_LENGTH_LIMIT_S = 3600 # 1 hour YouTube files
|
16 |
|
17 |
# 加载WhisperX模型
|
18 |
+
# @spaces.GPU
|
19 |
+
# def load_whisperx_model():
|
20 |
+
# # 加载 WhisperX 模型
|
21 |
return whisperx.load_model(MODEL_NAME, device=device, compute_type=compute_type)
|
22 |
|
23 |
+
# model = load_whisperx_model()
|
24 |
|
25 |
@spaces.GPU
|
26 |
def transcribe(inputs, task):
|
27 |
+
model = whisperx.load_model(MODEL_NAME, device=device, compute_type=compute_type)
|
28 |
+
|
29 |
if inputs is None:
|
30 |
raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
|
31 |
|