Spaces:
Running
on
Zero
Running
on
Zero
rafaaa2105
commited on
Commit
•
0eac81e
1
Parent(s):
2986f68
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ def extract_audio(video_path):
|
|
16 |
|
17 |
def generate_subtitles(audio_path):
|
18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
19 |
-
processor = WhisperProcessor.from_pretrained("openai/whisper-
|
20 |
-
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-
|
21 |
|
22 |
# Load and preprocess the audio
|
23 |
audio_input, _ = librosa.load(audio_path, sr=16000)
|
|
|
16 |
|
17 |
def generate_subtitles(audio_path):
|
18 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
19 |
+
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v3")
|
20 |
+
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3").to(device)
|
21 |
|
22 |
# Load and preprocess the audio
|
23 |
audio_input, _ = librosa.load(audio_path, sr=16000)
|