Spaces:
Running on Zero
Running on Zero
Commit ·
807c399
1
Parent(s): a266796
Add gpu decorator for zero gpu support
Browse files
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."
|