Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -246,15 +246,20 @@ label_mapping = {
|
|
246 |
8: "Strangers"
|
247 |
}
|
248 |
|
249 |
-
# Make prediction
|
250 |
if st.button('Submit'):
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
# Convert numpy array to int if it's a single value array
|
255 |
-
if isinstance(prediction_numeric, np.ndarray) and prediction_numeric.size == 1:
|
256 |
-
|
257 |
-
|
258 |
|
259 |
# Assuming 'predicted_label' is defined and holds the prediction result
|
260 |
|
|
|
246 |
8: "Strangers"
|
247 |
}
|
248 |
|
249 |
+
# Make prediction for demo purposes
|
250 |
if st.button('Submit'):
|
251 |
+
# Choose a random key from label_mapping
|
252 |
+
random_key = random.choice(list(label_mapping.keys()))
|
253 |
+
random_label = label_mapping[random_key]
|
254 |
+
|
255 |
+
#if st.button('Submit'):
|
256 |
+
# prediction_numeric = model.predict(df)[0]
|
257 |
+
# prediction_numeric=prediction_numeric+1
|
258 |
|
259 |
# Convert numpy array to int if it's a single value array
|
260 |
+
# if isinstance(prediction_numeric, np.ndarray) and prediction_numeric.size == 1:
|
261 |
+
# prediction_numeric = int(prediction_numeric)
|
262 |
+
# predicted_label = label_mapping.get(prediction_numeric, "Unknown")
|
263 |
|
264 |
# Assuming 'predicted_label' is defined and holds the prediction result
|
265 |
|