Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
|
|
8 |
genai.configure(api_key=GOOGLE_API_KEY)
|
9 |
|
10 |
def summarize_audio(audio_file_path, prompt):
|
11 |
-
"""Summarize the audio using Google's Generative API."""
|
12 |
model = genai.GenerativeModel("models/gemini-1.5-pro-latest")
|
13 |
audio_file = genai.upload_file(path=audio_file_path)
|
14 |
response = model.generate_content(
|
@@ -30,12 +30,12 @@ def save_uploaded_file(uploaded_file):
|
|
30 |
return None
|
31 |
|
32 |
# Streamlit app interface
|
33 |
-
st.title('
|
34 |
|
35 |
-
with st.expander("About
|
36 |
st.write("""
|
37 |
-
This application utilizes Google's generative AI to
|
38 |
-
Simply upload your WAV or MP3 file and provide a prompt to receive
|
39 |
""")
|
40 |
|
41 |
audio_file = st.file_uploader("Upload Audio File", type=['wav', 'mp3'])
|
@@ -45,8 +45,8 @@ if audio_file is not None:
|
|
45 |
|
46 |
prompt = st.text_input("Enter your prompt:", "Please summarize the following audio.")
|
47 |
|
48 |
-
if st.button('
|
49 |
-
with st.spinner('Please Wait :
|
50 |
summary_text = summarize_audio(audio_path, prompt)
|
51 |
st.info(summary_text)
|
52 |
|
|
|
8 |
genai.configure(api_key=GOOGLE_API_KEY)
|
9 |
|
10 |
def summarize_audio(audio_file_path, prompt):
|
11 |
+
"""Summarize and extract the audio using Google's Generative API."""
|
12 |
model = genai.GenerativeModel("models/gemini-1.5-pro-latest")
|
13 |
audio_file = genai.upload_file(path=audio_file_path)
|
14 |
response = model.generate_content(
|
|
|
30 |
return None
|
31 |
|
32 |
# Streamlit app interface
|
33 |
+
st.title('SoundScape Intelligence: Unveiling Insights from Audio')
|
34 |
|
35 |
+
with st.expander("About SoundScape Intelligence app"):
|
36 |
st.write("""
|
37 |
+
This application utilizes Google's generative AI to summarize and extract key points from audio files .
|
38 |
+
Simply upload your WAV or MP3 file and provide a prompt to receive insight from the files.
|
39 |
""")
|
40 |
|
41 |
audio_file = st.file_uploader("Upload Audio File", type=['wav', 'mp3'])
|
|
|
45 |
|
46 |
prompt = st.text_input("Enter your prompt:", "Please summarize the following audio.")
|
47 |
|
48 |
+
if st.button('Extract Insight from Audio'):
|
49 |
+
with st.spinner('Please Wait : Extracting Information...'):
|
50 |
summary_text = summarize_audio(audio_path, prompt)
|
51 |
st.info(summary_text)
|
52 |
|