Spaces:
Sleeping
Sleeping
commit v3
Browse files
app.py
CHANGED
@@ -1,4 +1,11 @@
|
|
1 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import requests
|
3 |
import tempfile
|
4 |
import streamlit as st
|
@@ -53,9 +60,7 @@ def extract_audio(video_path, audio_path):
|
|
53 |
|
54 |
@st.cache_resource(show_spinner="Loading model...")
|
55 |
def load_model():
|
56 |
-
model_path = "/
|
57 |
-
|
58 |
-
# ✅ Ensure the /data directory exists and is writable
|
59 |
os.makedirs(model_path, exist_ok=True)
|
60 |
|
61 |
classifier = EncoderClassifier.from_hparams(
|
|
|
1 |
import os
|
2 |
+
|
3 |
+
# Fix permission errors for Streamlit
|
4 |
+
os.environ["STREAMLIT_CONFIG_DIR"] = "/tmp/streamlit/config"
|
5 |
+
os.environ["STREAMLIT_CACHE_DIR"] = "/tmp/streamlit/cache"
|
6 |
+
os.environ["STREAMLIT_STATIC_DIR"] = "/tmp/streamlit/static"
|
7 |
+
os.environ["STREAMLIT_RUNTIME_DIR"] = "/tmp/streamlit/runtime"
|
8 |
+
|
9 |
import requests
|
10 |
import tempfile
|
11 |
import streamlit as st
|
|
|
60 |
|
61 |
@st.cache_resource(show_spinner="Loading model...")
|
62 |
def load_model():
|
63 |
+
model_path = "/tmp/accent-id-model" # ✅ switch from /data to /tmp
|
|
|
|
|
64 |
os.makedirs(model_path, exist_ok=True)
|
65 |
|
66 |
classifier = EncoderClassifier.from_hparams(
|