Vlad Bastina commited on
Commit
4b0698a
·
1 Parent(s): c9618c0
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -5,6 +5,7 @@ from cloud_speech import get_transcription
5
  from moviepy import VideoFileClip
6
  import json
7
  from pathlib import Path
 
8
 
9
  def extract_audio(video_path, audio_path):
10
  video = VideoFileClip(video_path)
@@ -38,14 +39,14 @@ if __name__ == "__main__":
38
  """, unsafe_allow_html=True)
39
  load_css("style.css")
40
 
41
- google_credentials_json = json.dumps(dict(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]))
42
 
43
- temp_file = "gcp_credentials.json"
44
- with open(temp_file, "w") as f:
45
- f.write(google_credentials_json)
46
 
47
- # Set the environment variable to point to the temporary file
48
- os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = temp_file
49
  st.title("🎥 AI-Powered Meeting Report Generator")
50
  st.write('''AI-Powered Meeting Report Generator is an intelligent tool that automatically analyzes video meetings and generates clear, concise summaries. Designed to save time and boost productivity, it captures key information—so your team can stay aligned without sifting through hours of recordings.
51
 
 
5
  from moviepy import VideoFileClip
6
  import json
7
  from pathlib import Path
8
+ import tempfile
9
 
10
  def extract_audio(video_path, audio_path):
11
  video = VideoFileClip(video_path)
 
39
  """, unsafe_allow_html=True)
40
  load_css("style.css")
41
 
42
+ google_credentials_json = json.loads(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"])
43
 
44
+ with tempfile.NamedTemporaryFile(mode='w+', delete=False) as temp_file:
45
+ json.dump(google_credentials_json, temp_file)
46
+ temp_file_path = temp_file.name
47
 
48
+ # Set environment variable (if needed by a library that expects GOOGLE_APPLICATION_CREDENTIALS env)
49
+ os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = temp_file_path
50
  st.title("🎥 AI-Powered Meeting Report Generator")
51
  st.write('''AI-Powered Meeting Report Generator is an intelligent tool that automatically analyzes video meetings and generates clear, concise summaries. Designed to save time and boost productivity, it captures key information—so your team can stay aligned without sifting through hours of recordings.
52