StevenChen16 commited on
Commit
a923bed
·
verified ·
1 Parent(s): 9a9ac31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- # 加载 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
  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