ACloudCenter commited on
Commit
807c399
·
1 Parent(s): a266796

Add gpu decorator for zero gpu support

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
 
2
  import torchaudio
3
  from transformers import AutoModelForSpeechSeq2Seq, PreTrainedTokenizerFast
4
-
5
  from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
6
 
7
  processor = AutoProcessor.from_pretrained("UsefulSensors/moonshine-tiny")
@@ -9,6 +9,7 @@ model = AutoModelForSpeechSeq2Seq.from_pretrained("UsefulSensors/moonshine-tiny"
9
  tokenizer = PreTrainedTokenizerFast.from_pretrained("UsefulSensors/moonshine-tiny")
10
 
11
 
 
12
  def transcribe_audio(audio_path):
13
  if audio_path is None:
14
  return "Please provide an audio input."
 
1
  import gradio as gr
2
+ import spaces
3
  import torchaudio
4
  from transformers import AutoModelForSpeechSeq2Seq, PreTrainedTokenizerFast
 
5
  from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq
6
 
7
  processor = AutoProcessor.from_pretrained("UsefulSensors/moonshine-tiny")
 
9
  tokenizer = PreTrainedTokenizerFast.from_pretrained("UsefulSensors/moonshine-tiny")
10
 
11
 
12
+ @spaces.GPU
13
  def transcribe_audio(audio_path):
14
  if audio_path is None:
15
  return "Please provide an audio input."