Spaces:
Running
on
Zero
Running
on
Zero
acumplid
commited on
Commit
·
c01ffa1
1
Parent(s):
c34ed98
add zerogpu
Browse files- app.py +2 -2
- whisper.py +1 -1
app.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from whisper import generate
|
| 3 |
from AinaTheme import theme
|
| 4 |
-
|
| 5 |
|
| 6 |
USE_V5 = False
|
| 7 |
|
| 8 |
-
|
| 9 |
def transcribe(inputs, model_version):
|
| 10 |
if inputs is None:
|
| 11 |
raise gr.Error("Cap fitxer d'àudio introduit! Si us plau pengeu un fitxer "\
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from whisper import generate
|
| 3 |
from AinaTheme import theme
|
| 4 |
+
import spaces
|
| 5 |
|
| 6 |
USE_V5 = False
|
| 7 |
|
| 8 |
+
@spaces.GPU
|
| 9 |
def transcribe(inputs, model_version):
|
| 10 |
if inputs is None:
|
| 11 |
raise gr.Error("Cap fitxer d'àudio introduit! Si us plau pengeu un fitxer "\
|
whisper.py
CHANGED
|
@@ -6,7 +6,7 @@ import torchaudio
|
|
| 6 |
import torch
|
| 7 |
import re
|
| 8 |
from transformers import pipeline
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
|
| 6 |
import torch
|
| 7 |
import re
|
| 8 |
from transformers import pipeline
|
| 9 |
+
import spaces
|
| 10 |
|
| 11 |
|
| 12 |
device = 0 if torch.cuda.is_available() else "cpu"
|