Sakil commited on
Commit
d535f5a
·
verified ·
1 Parent(s): 5a3ce71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -3,9 +3,6 @@ import tempfile
3
  import os
4
  import google.generativeai as genai
5
 
6
- #from dotenv import load_dotenv
7
-
8
- #load_dotenv()
9
 
10
  # Configure Google API for audio summarization
11
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
@@ -34,7 +31,7 @@ def save_uploaded_file(uploaded_file):
34
  return None
35
 
36
  # Streamlit app interface
37
- st.title('Your Audio Summarization App')
38
 
39
  with st.expander("About Summarization app"):
40
  st.write("""
@@ -50,4 +47,12 @@ if audio_file is not None:
50
  if st.button('Summarize Audio'):
51
  with st.spinner('Please Wait : Summarizing...'):
52
  summary_text = summarize_audio(audio_path)
53
- st.info(summary_text)
 
 
 
 
 
 
 
 
 
3
  import os
4
  import google.generativeai as genai
5
 
 
 
 
6
 
7
  # Configure Google API for audio summarization
8
  GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
 
31
  return None
32
 
33
  # Streamlit app interface
34
+ st.title('Your AI Audio Summarization App')
35
 
36
  with st.expander("About Summarization app"):
37
  st.write("""
 
47
  if st.button('Summarize Audio'):
48
  with st.spinner('Please Wait : Summarizing...'):
49
  summary_text = summarize_audio(audio_path)
50
+ st.info(summary_text)
51
+
52
+ # Add a section to enter Google API Key
53
+ st.sidebar.header("Google API Key")
54
+ new_key = st.sidebar.text_input("Enter your Google API Key:", value=GOOGLE_API_KEY)
55
+ if new_key:
56
+ os.environ["GOOGLE_API_KEY"] = new_key
57
+ GOOGLE_API_KEY = new_key
58
+ genai.configure(api_key=GOOGLE_API_KEY)