Spaces:
Runtime error
Runtime error
remove tensorflow until model is ready - get space live
Browse files- requirements.txt +1 -2
- src/streamlit_app.py +4 -9
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
streamlit
|
| 2 |
pandas
|
| 3 |
numpy
|
| 4 |
-
|
| 5 |
-
scipy
|
|
|
|
| 1 |
streamlit
|
| 2 |
pandas
|
| 3 |
numpy
|
| 4 |
+
scipy
|
|
|
src/streamlit_app.py
CHANGED
|
@@ -35,12 +35,7 @@ EXPLANATIONS = {
|
|
| 35 |
|
| 36 |
@st.cache_resource
|
| 37 |
def load_model():
|
| 38 |
-
|
| 39 |
-
import tensorflow as tf
|
| 40 |
-
model = tf.keras.models.load_model("model.keras")
|
| 41 |
-
return model
|
| 42 |
-
except Exception:
|
| 43 |
-
return None
|
| 44 |
|
| 45 |
# ββ Page config βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 46 |
|
|
@@ -78,9 +73,9 @@ with st.sidebar:
|
|
| 78 |
|
| 79 |
# ββ Model status βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 80 |
|
| 81 |
-
model = load_model()
|
| 82 |
|
| 83 |
-
if
|
| 84 |
st.warning(
|
| 85 |
"β οΈ Model not yet available. "
|
| 86 |
"The interface is fully built β predictions will activate once "
|
|
@@ -129,7 +124,7 @@ with tab1:
|
|
| 129 |
st.metric("Feature count", len(feature_vector))
|
| 130 |
|
| 131 |
if st.button("π Classify this sample", type="primary"):
|
| 132 |
-
if
|
| 133 |
st.error("Model not loaded β cannot predict yet.")
|
| 134 |
else:
|
| 135 |
arr = feature_vector.reshape(1, -1)
|
|
|
|
| 35 |
|
| 36 |
@st.cache_resource
|
| 37 |
def load_model():
|
| 38 |
+
return None, "no_model"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# ββ Page config βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 41 |
|
|
|
|
| 73 |
|
| 74 |
# ββ Model status βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 75 |
|
| 76 |
+
model, model_status = load_model()
|
| 77 |
|
| 78 |
+
if model_status == "no_model":
|
| 79 |
st.warning(
|
| 80 |
"β οΈ Model not yet available. "
|
| 81 |
"The interface is fully built β predictions will activate once "
|
|
|
|
| 124 |
st.metric("Feature count", len(feature_vector))
|
| 125 |
|
| 126 |
if st.button("π Classify this sample", type="primary"):
|
| 127 |
+
if model_status == "no_model":
|
| 128 |
st.error("Model not loaded β cannot predict yet.")
|
| 129 |
else:
|
| 130 |
arr = feature_vector.reshape(1, -1)
|