Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from pyannote.audio import Pipeline
|
| 3 |
-
|
| 4 |
import tempfile
|
| 5 |
import os
|
| 6 |
import torch
|
|
@@ -14,7 +14,7 @@ def load_models():
|
|
| 14 |
use_auth_token=st.secrets["hf_token"]
|
| 15 |
)
|
| 16 |
|
| 17 |
-
transcriber = whisper.load_model("
|
| 18 |
|
| 19 |
summarizer = tf_pipeline(
|
| 20 |
"summarization",
|
|
@@ -27,7 +27,7 @@ def load_models():
|
|
| 27 |
st.error(f"Error loading models: {str(e)}")
|
| 28 |
return None, None, None
|
| 29 |
|
| 30 |
-
def process_audio(audio_file, max_duration=
|
| 31 |
try:
|
| 32 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 33 |
tmp.write(audio_file.getvalue())
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from pyannote.audio import Pipeline
|
| 3 |
+
import whisper # Changed import
|
| 4 |
import tempfile
|
| 5 |
import os
|
| 6 |
import torch
|
|
|
|
| 14 |
use_auth_token=st.secrets["hf_token"]
|
| 15 |
)
|
| 16 |
|
| 17 |
+
transcriber = whisper.load_model("turbo")
|
| 18 |
|
| 19 |
summarizer = tf_pipeline(
|
| 20 |
"summarization",
|
|
|
|
| 27 |
st.error(f"Error loading models: {str(e)}")
|
| 28 |
return None, None, None
|
| 29 |
|
| 30 |
+
def process_audio(audio_file, max_duration=600): # limit to 5 minutes initially
|
| 31 |
try:
|
| 32 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 33 |
tmp.write(audio_file.getvalue())
|