Kr08 commited on
Commit
e30002c
·
verified ·
1 Parent(s): 48be59b

Update audio_processing.py

Browse files
Files changed (1) hide show
  1. audio_processing.py +3 -3
audio_processing.py CHANGED
@@ -18,7 +18,7 @@ def resample_with_ffmpeg(input_file, output_file, target_sr=16000):
18
  ]
19
  subprocess.run(command, check=True)
20
 
21
- +@spaces.GPU
22
  def detect_language(audio):
23
  whisper_model = get_whisper_model_small()
24
 
@@ -53,7 +53,7 @@ def detect_language(audio):
53
  return detected_lang
54
 
55
 
56
- +@spaces.GPU
57
  def process_long_audio(audio, task="transcribe", language=None):
58
  if audio[0] != SAMPLING_RATE:
59
  # Save the input audio to a file for ffmpeg processing
@@ -110,7 +110,7 @@ def process_long_audio(audio, task="transcribe", language=None):
110
  return " ".join(results)
111
 
112
 
113
- +@spaces.GPU
114
  def process_audio(audio):
115
  if audio is None:
116
  return "No file uploaded", "", ""
 
18
  ]
19
  subprocess.run(command, check=True)
20
 
21
+ @spaces.GPU
22
  def detect_language(audio):
23
  whisper_model = get_whisper_model_small()
24
 
 
53
  return detected_lang
54
 
55
 
56
+ @spaces.GPU
57
  def process_long_audio(audio, task="transcribe", language=None):
58
  if audio[0] != SAMPLING_RATE:
59
  # Save the input audio to a file for ffmpeg processing
 
110
  return " ".join(results)
111
 
112
 
113
+ @spaces.GPU
114
  def process_audio(audio):
115
  if audio is None:
116
  return "No file uploaded", "", ""