Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,8 @@ N_FEATURES = model.input_shape[1]
|
|
| 12 |
|
| 13 |
def predict_csv(file):
|
| 14 |
df = pd.read_csv(file)
|
| 15 |
-
|
|
|
|
| 16 |
# Check number of features
|
| 17 |
if df.shape[1] != N_FEATURES:
|
| 18 |
return f"Expected {N_FEATURES} features, but got {df.shape[1]} columns."
|
|
|
|
| 12 |
|
| 13 |
def predict_csv(file):
|
| 14 |
df = pd.read_csv(file)
|
| 15 |
+
# Drop label column
|
| 16 |
+
df = df.drop(columns=["Label", "label", "Class", "class"], errors="ignore")
|
| 17 |
# Check number of features
|
| 18 |
if df.shape[1] != N_FEATURES:
|
| 19 |
return f"Expected {N_FEATURES} features, but got {df.shape[1]} columns."
|