Vlad Bastina commited on
Commit
d66a98b
·
1 Parent(s): 41799b3

style css

Browse files
Files changed (2) hide show
  1. app.py +14 -0
  2. style.css +0 -0
app.py CHANGED
@@ -11,6 +11,18 @@ def extract_audio(video_path, audio_path):
11
  audio.write_audiofile(audio_path, codec="pcm_s16le") # Save as WAV (best for transcription)
12
  video.close()
13
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  st.cache_resource()
15
  def load_resources():
16
  client = VideoProcessingClient(api_key=api_key, model_name='gemini-2.0-pro-exp-02-05')
@@ -18,6 +30,8 @@ def load_resources():
18
  return client
19
 
20
  if __name__ == "__main__":
 
 
21
  google_credentials_json = json.dumps(dict(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]))
22
 
23
  temp_file = "gcp_credentials.json"
 
11
  audio.write_audiofile(audio_path, codec="pcm_s16le") # Save as WAV (best for transcription)
12
  video.close()
13
 
14
+ def load_css(file_name):
15
+ """Loads a CSS file and injects it into the Streamlit app."""
16
+ try:
17
+ css_path = Path(__file__).parent / file_name
18
+ with open(css_path) as f:
19
+ st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
20
+ # st.info(f"Loaded CSS: {file_name}") # Optional: uncomment for debugging
21
+ except FileNotFoundError:
22
+ st.error(f"CSS file not found: {file_name}. Make sure it's in the same directory as app.py.")
23
+ except Exception as e:
24
+ st.error(f"Error loading CSS file {file_name}: {e}")
25
+
26
  st.cache_resource()
27
  def load_resources():
28
  client = VideoProcessingClient(api_key=api_key, model_name='gemini-2.0-pro-exp-02-05')
 
30
  return client
31
 
32
  if __name__ == "__main__":
33
+ load_css("style.css")
34
+
35
  google_credentials_json = json.dumps(dict(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]))
36
 
37
  temp_file = "gcp_credentials.json"
style.css ADDED
File without changes