sanchit-gandhi HF staff commited on
Commit
502b397
1 Parent(s): c9f5aff

Use zero GPU

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
2
  from transformers.utils import is_flash_attn_2_available, is_torch_sdpa_available
3
  from transformers.pipelines.audio_utils import ffmpeg_read
@@ -52,6 +53,7 @@ distil_pipe = pipeline(
52
  distil_pipe_forward = distil_pipe._forward
53
 
54
 
 
55
  def transcribe(inputs):
56
  if inputs is None:
57
  raise gr.Error("No audio file submitted! Please record or upload an audio file before submitting your request.")
 
1
+ import spaces
2
  from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
3
  from transformers.utils import is_flash_attn_2_available, is_torch_sdpa_available
4
  from transformers.pipelines.audio_utils import ffmpeg_read
 
53
  distil_pipe_forward = distil_pipe._forward
54
 
55
 
56
+ @spaces.GPU
57
  def transcribe(inputs):
58
  if inputs is None:
59
  raise gr.Error("No audio file submitted! Please record or upload an audio file before submitting your request.")