Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ from fastai.tabular.all import load_learner
|
|
| 4 |
import random
|
| 5 |
import torch
|
| 6 |
import joblib
|
| 7 |
-
from sklearn.preprocessing import LabelEncoder
|
| 8 |
import numpy as np
|
| 9 |
|
| 10 |
# Set random seed for reproducibility
|
|
@@ -28,6 +27,11 @@ def predict_location(input_data):
|
|
| 28 |
|
| 29 |
# Convert the index to the corresponding location
|
| 30 |
location = label_encoder.inverse_transform([pred_idx])[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
return location
|
| 32 |
|
| 33 |
# Streamlit app
|
|
|
|
| 4 |
import random
|
| 5 |
import torch
|
| 6 |
import joblib
|
|
|
|
| 7 |
import numpy as np
|
| 8 |
|
| 9 |
# Set random seed for reproducibility
|
|
|
|
| 27 |
|
| 28 |
# Convert the index to the corresponding location
|
| 29 |
location = label_encoder.inverse_transform([pred_idx])[0]
|
| 30 |
+
|
| 31 |
+
# Debugging: Output probabilities and index
|
| 32 |
+
print(f"Probabilities: {probabilities.numpy()}")
|
| 33 |
+
print(f"Predicted index: {pred_idx}")
|
| 34 |
+
|
| 35 |
return location
|
| 36 |
|
| 37 |
# Streamlit app
|