Spaces:
Runtime error
Runtime error
Commit
Β·
f6644ad
1
Parent(s):
0c09fe8
Update app.py
Browse files
app.py
CHANGED
@@ -107,9 +107,11 @@ def main():
|
|
107 |
st.header("Is it human-made π or Generated with AI π€ ? ")
|
108 |
|
109 |
# Check the model to use
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
113 |
|
114 |
# Load the selected trained model
|
115 |
if option in ("BERT-based model", "DistilBERT-based model (BERT light)"):
|
@@ -160,7 +162,7 @@ def main():
|
|
160 |
|
161 |
if st.button("Model Explanation"):
|
162 |
# Check if there's text in the session state
|
163 |
-
if "text" in st.session_state:
|
164 |
|
165 |
if option in ("Naive Bayes", "Logistic Regression"):
|
166 |
with st.spinner('Wait for it π...'):
|
|
|
107 |
st.header("Is it human-made π or Generated with AI π€ ? ")
|
108 |
|
109 |
# Check the model to use
|
110 |
+
def restore_prediction_state():
|
111 |
+
if "prediction" in st.session_state:
|
112 |
+
del st.session_state.prediction
|
113 |
+
option = st.selectbox("Select a model to use:", models_available, on_change=restore_prediction_state)
|
114 |
+
|
115 |
|
116 |
# Load the selected trained model
|
117 |
if option in ("BERT-based model", "DistilBERT-based model (BERT light)"):
|
|
|
162 |
|
163 |
if st.button("Model Explanation"):
|
164 |
# Check if there's text in the session state
|
165 |
+
if "text" in st.session_state and "prediction" in st.session_state:
|
166 |
|
167 |
if option in ("Naive Bayes", "Logistic Regression"):
|
168 |
with st.spinner('Wait for it π...'):
|