Spaces:
Running
on
Zero
Running
on
Zero
laubonghaudoi
commited on
Commit
•
63b819c
1
Parent(s):
163d736
feat: Update app for GPU support and modify requirements for torch
Browse files- app.py +6 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import logging
|
2 |
import tempfile
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
|
@@ -18,7 +19,12 @@ logger = logging.getLogger(__name__)
|
|
18 |
def transcribe_audio(audio_path):
|
19 |
"""Process audio file and return SRT content and preview text"""
|
20 |
try:
|
|
|
|
|
|
|
|
|
21 |
transcriber = AutoTranscriber(
|
|
|
22 |
corrector="opencc",
|
23 |
use_denoiser=False,
|
24 |
with_punct=False
|
|
|
1 |
import logging
|
2 |
import tempfile
|
3 |
+
import torch
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
19 |
def transcribe_audio(audio_path):
|
20 |
"""Process audio file and return SRT content and preview text"""
|
21 |
try:
|
22 |
+
# Check if CUDA is available and set the device
|
23 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
24 |
+
logger.info(f"Using device: {device}")
|
25 |
+
|
26 |
transcriber = AutoTranscriber(
|
27 |
+
device=device,
|
28 |
corrector="opencc",
|
29 |
use_denoiser=False,
|
30 |
with_punct=False
|
requirements.txt
CHANGED
@@ -10,4 +10,4 @@ pytest
|
|
10 |
pytubefix
|
11 |
resampy
|
12 |
torch
|
13 |
-
torchaudio
|
|
|
10 |
pytubefix
|
11 |
resampy
|
12 |
torch
|
13 |
+
torchaudio
|