Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,12 @@ device = "cpu"
|
|
| 16 |
whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained("openai/whisper-tiny").to(device)
|
| 17 |
processor = AutoProcessor.from_pretrained("openai/whisper-tiny")
|
| 18 |
whisper_pipeline = pipeline("automatic-speech-recognition", model="openai/whisper-tiny", device=device)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
# Load Stable Diffusion model
|
|
|
|
| 16 |
whisper_model = AutoModelForSpeechSeq2Seq.from_pretrained("openai/whisper-tiny").to(device)
|
| 17 |
processor = AutoProcessor.from_pretrained("openai/whisper-tiny")
|
| 18 |
whisper_pipeline = pipeline("automatic-speech-recognition", model="openai/whisper-tiny", device=device)
|
| 19 |
+
# Transcribe with Whisper Tiny
|
| 20 |
+
with torch.no_grad():
|
| 21 |
+
result = whisper_pipeline(temp_audio_path, return_timestamps=True)
|
| 22 |
+
text_output = result["text"]
|
| 23 |
+
|
| 24 |
+
st.write("Transcribed Text:", text_output)
|
| 25 |
|
| 26 |
|
| 27 |
# Load Stable Diffusion model
|