Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,8 @@ from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
|
5 |
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
|
6 |
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
|
7 |
|
8 |
-
def transcribe_audio(
|
9 |
-
|
10 |
-
audio_data = f.read()
|
11 |
|
12 |
# Get audio features
|
13 |
input_features = processor(audio_data, return_tensors="pt").input_features
|
|
|
5 |
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
|
6 |
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
|
7 |
|
8 |
+
def transcribe_audio(audio_file) -> str:
|
9 |
+
audio_data = audio_file.read()
|
|
|
10 |
|
11 |
# Get audio features
|
12 |
input_features = processor(audio_data, return_tensors="pt").input_features
|