adrian-saez-martinez
commited on
Commit
·
754df64
1
Parent(s):
198dcba
added spaces GPU
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ pipe_standard = pipeline(
|
|
| 26 |
)
|
| 27 |
|
| 28 |
# Function to transcribe audio using the turbo model
|
|
|
|
| 29 |
def transcribe_turbo(audio):
|
| 30 |
start_time = time.time()
|
| 31 |
text_turbo = pipe_turbo(audio)["text"]
|
|
@@ -33,6 +34,7 @@ def transcribe_turbo(audio):
|
|
| 33 |
return text_turbo, elapsed_time
|
| 34 |
|
| 35 |
# Function to transcribe audio using the standard model
|
|
|
|
| 36 |
def transcribe_standard(audio):
|
| 37 |
start_time = time.time()
|
| 38 |
text_standard = pipe_standard(audio)["text"]
|
|
@@ -40,6 +42,7 @@ def transcribe_standard(audio):
|
|
| 40 |
return text_standard, elapsed_time
|
| 41 |
|
| 42 |
# Function to compare transcriptions and speed
|
|
|
|
| 43 |
def compare_transcriptions(audio):
|
| 44 |
if audio is None:
|
| 45 |
raise gr.Error("No audio file submitted! Please record an audio before submitting your request.")
|
|
|
|
| 26 |
)
|
| 27 |
|
| 28 |
# Function to transcribe audio using the turbo model
|
| 29 |
+
@spaces.GPU
|
| 30 |
def transcribe_turbo(audio):
|
| 31 |
start_time = time.time()
|
| 32 |
text_turbo = pipe_turbo(audio)["text"]
|
|
|
|
| 34 |
return text_turbo, elapsed_time
|
| 35 |
|
| 36 |
# Function to transcribe audio using the standard model
|
| 37 |
+
@spaces.GPU
|
| 38 |
def transcribe_standard(audio):
|
| 39 |
start_time = time.time()
|
| 40 |
text_standard = pipe_standard(audio)["text"]
|
|
|
|
| 42 |
return text_standard, elapsed_time
|
| 43 |
|
| 44 |
# Function to compare transcriptions and speed
|
| 45 |
+
@spaces.GPU
|
| 46 |
def compare_transcriptions(audio):
|
| 47 |
if audio is None:
|
| 48 |
raise gr.Error("No audio file submitted! Please record an audio before submitting your request.")
|