Spaces:
Running
Running
Vlad Bastina commited on
Commit ·
bd56164
1
Parent(s): 1aa0e2b
style css
Browse files- __pycache__/transcription_correction.cpython-311.pyc +0 -0
- app.py +15 -0
- style.css +0 -0
__pycache__/transcription_correction.cpython-311.pyc
CHANGED
|
Binary files a/__pycache__/transcription_correction.cpython-311.pyc and b/__pycache__/transcription_correction.cpython-311.pyc differ
|
|
|
app.py
CHANGED
|
@@ -6,13 +6,28 @@ import os
|
|
| 6 |
from faster_whisper import WhisperModel
|
| 7 |
from streamlit_mic_recorder import mic_recorder
|
| 8 |
from transcription_correction import ask_gemini
|
|
|
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# Load Whisper Model
|
| 11 |
@st.cache_resource()
|
| 12 |
def load_model():
|
| 13 |
model_size = "large-v3"
|
| 14 |
return WhisperModel(model_size, device="cpu", compute_type="int8")
|
| 15 |
|
|
|
|
| 16 |
model = load_model()
|
| 17 |
os.environ["GOOGLE_API_KEY"] = st.secrets['GOOGLE_API_KEY']
|
| 18 |
st.title("Whisper Transcription Demo")
|
|
|
|
| 6 |
from faster_whisper import WhisperModel
|
| 7 |
from streamlit_mic_recorder import mic_recorder
|
| 8 |
from transcription_correction import ask_gemini
|
| 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 |
+
|
| 24 |
# Load Whisper Model
|
| 25 |
@st.cache_resource()
|
| 26 |
def load_model():
|
| 27 |
model_size = "large-v3"
|
| 28 |
return WhisperModel(model_size, device="cpu", compute_type="int8")
|
| 29 |
|
| 30 |
+
load_css("style.css")
|
| 31 |
model = load_model()
|
| 32 |
os.environ["GOOGLE_API_KEY"] = st.secrets['GOOGLE_API_KEY']
|
| 33 |
st.title("Whisper Transcription Demo")
|
style.css
ADDED
|
File without changes
|