Spaces:
Sleeping
Sleeping
Vlad Bastina commited on
Commit ·
6add02a
1
Parent(s): 446b11f
style css
Browse files
app.py
CHANGED
|
@@ -8,9 +8,26 @@ import io
|
|
| 8 |
import tempfile
|
| 9 |
import json
|
| 10 |
from pydub import AudioSegment # Used to ensure WAV format if needed
|
|
|
|
| 11 |
|
| 12 |
# --- Configuration ---
|
| 13 |
st.set_page_config(layout="wide", page_title="Audio Sentiment Analysis")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
st.title("🗣️ Audio Sentiment Analysis with Gemini")
|
| 15 |
st.markdown("""
|
| 16 |
Upload a WAV file, record new audio, or use the default example. The app will use Google's Gemini model
|
|
|
|
| 8 |
import tempfile
|
| 9 |
import json
|
| 10 |
from pydub import AudioSegment # Used to ensure WAV format if needed
|
| 11 |
+
from pathlib import Path
|
| 12 |
|
| 13 |
# --- Configuration ---
|
| 14 |
st.set_page_config(layout="wide", page_title="Audio Sentiment Analysis")
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def load_css(file_name):
|
| 18 |
+
"""Loads a CSS file and injects it into the Streamlit app."""
|
| 19 |
+
try:
|
| 20 |
+
css_path = Path(__file__).parent / file_name
|
| 21 |
+
with open(css_path) as f:
|
| 22 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
| 23 |
+
# st.info(f"Loaded CSS: {file_name}") # Optional: uncomment for debugging
|
| 24 |
+
except FileNotFoundError:
|
| 25 |
+
st.error(f"CSS file not found: {file_name}. Make sure it's in the same directory as app.py.")
|
| 26 |
+
except Exception as e:
|
| 27 |
+
st.error(f"Error loading CSS file {file_name}: {e}")
|
| 28 |
+
|
| 29 |
+
load_css("style.css")
|
| 30 |
+
|
| 31 |
st.title("🗣️ Audio Sentiment Analysis with Gemini")
|
| 32 |
st.markdown("""
|
| 33 |
Upload a WAV file, record new audio, or use the default example. The app will use Google's Gemini model
|
style.css
ADDED
|
File without changes
|