Spaces:
Sleeping
Sleeping
Vlad Bastina commited on
Commit ·
cda2b3f
1
Parent(s): 068665b
style css
Browse files- __pycache__/gemini_call.cpython-312.pyc +0 -0
- __pycache__/sentiment_analysis.cpython-312.pyc +0 -0
- __pycache__/translation.cpython-312.pyc +0 -0
- streamlit_app.py +16 -1
- style.css +0 -0
- translation.py +1 -1
__pycache__/gemini_call.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/gemini_call.cpython-312.pyc and b/__pycache__/gemini_call.cpython-312.pyc differ
|
|
|
__pycache__/sentiment_analysis.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/sentiment_analysis.cpython-312.pyc and b/__pycache__/sentiment_analysis.cpython-312.pyc differ
|
|
|
__pycache__/translation.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/translation.cpython-312.pyc and b/__pycache__/translation.cpython-312.pyc differ
|
|
|
streamlit_app.py
CHANGED
|
@@ -6,6 +6,21 @@ from sentiment_analysis import get_analysis
|
|
| 6 |
from PIL import Image
|
| 7 |
import os
|
| 8 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
os.environ['GOOGLE_API_KEY'] = st.secrets['GOOGLE_API_KEY']
|
| 11 |
google_credentials_json = json.dumps(dict(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]))
|
|
@@ -87,4 +102,4 @@ def main():
|
|
| 87 |
time.sleep(0.1)
|
| 88 |
|
| 89 |
if __name__ == "__main__":
|
| 90 |
-
main()
|
|
|
|
| 6 |
from PIL import Image
|
| 7 |
import os
|
| 8 |
import json
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
def load_css(file_name):
|
| 12 |
+
"""Loads a CSS file and injects it into the Streamlit app."""
|
| 13 |
+
try:
|
| 14 |
+
css_path = Path(__file__).parent / file_name
|
| 15 |
+
with open(css_path) as f:
|
| 16 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
| 17 |
+
# st.info(f"Loaded CSS: {file_name}") # Optional: uncomment for debugging
|
| 18 |
+
except FileNotFoundError:
|
| 19 |
+
st.error(f"CSS file not found: {file_name}. Make sure it's in the same directory as app.py.")
|
| 20 |
+
except Exception as e:
|
| 21 |
+
st.error(f"Error loading CSS file {file_name}: {e}")
|
| 22 |
+
|
| 23 |
+
load_css("style.css")
|
| 24 |
|
| 25 |
os.environ['GOOGLE_API_KEY'] = st.secrets['GOOGLE_API_KEY']
|
| 26 |
google_credentials_json = json.dumps(dict(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]))
|
|
|
|
| 102 |
time.sleep(0.1)
|
| 103 |
|
| 104 |
if __name__ == "__main__":
|
| 105 |
+
main()
|
style.css
ADDED
|
File without changes
|
translation.py
CHANGED
|
@@ -64,4 +64,4 @@ if __name__=="__main__":
|
|
| 64 |
output_path = "audio_mono.wav"
|
| 65 |
convert_to_mono(file_path,output_path)
|
| 66 |
final_transcript = transcribe_audio(output_path)
|
| 67 |
-
print(final_transcript)
|
|
|
|
| 64 |
output_path = "audio_mono.wav"
|
| 65 |
convert_to_mono(file_path,output_path)
|
| 66 |
final_transcript = transcribe_audio(output_path)
|
| 67 |
+
print(final_transcript)
|