Spaces:
Running
Running
ZeroGPU spaces
Browse files- app.py +2 -0
- requirements.txt +1 -0
app.py
CHANGED
@@ -4,6 +4,7 @@ import torch
|
|
4 |
import numpy as np
|
5 |
import librosa
|
6 |
from transformers import AutoProcessor, Wav2Vec2BertForCTC
|
|
|
7 |
|
8 |
MODEL_NAME = "mikr/w2v-bert-2.0-czech-colab-cv16"
|
9 |
|
@@ -15,6 +16,7 @@ processor = AutoProcessor.from_pretrained(MODEL_NAME)
|
|
15 |
model = Wav2Vec2BertForCTC.from_pretrained(MODEL_NAME).to(device)
|
16 |
|
17 |
|
|
|
18 |
def transcribe(audio_path):
|
19 |
a, s = librosa.load(audio_path, sr=16_000)
|
20 |
|
|
|
4 |
import numpy as np
|
5 |
import librosa
|
6 |
from transformers import AutoProcessor, Wav2Vec2BertForCTC
|
7 |
+
import spaces
|
8 |
|
9 |
MODEL_NAME = "mikr/w2v-bert-2.0-czech-colab-cv16"
|
10 |
|
|
|
16 |
model = Wav2Vec2BertForCTC.from_pretrained(MODEL_NAME).to(device)
|
17 |
|
18 |
|
19 |
+
@spaces.GPU
|
20 |
def transcribe(audio_path):
|
21 |
a, s = librosa.load(audio_path, sr=16_000)
|
22 |
|
requirements.txt
CHANGED
@@ -3,3 +3,4 @@ torch
|
|
3 |
soundfile
|
4 |
librosa
|
5 |
ffmpy
|
|
|
|
3 |
soundfile
|
4 |
librosa
|
5 |
ffmpy
|
6 |
+
spaces
|