Spaces:
Sleeping
Sleeping
Amol Kaushik commited on
Commit ·
8ed5965
1
Parent(s): c734b33
Fix dataset path to Datasets_all/A2_dataset_80.csv
Browse files
app.py
CHANGED
|
@@ -97,9 +97,8 @@ def load_example():
|
|
| 97 |
|
| 98 |
try:
|
| 99 |
possible_paths = [
|
| 100 |
-
|
| 101 |
"A2/A2_dataset.csv",
|
| 102 |
-
"../A2/A2_dataset.csv",
|
| 103 |
"../Datasets_all/A2_dataset_80.csv",
|
| 104 |
]
|
| 105 |
|
|
@@ -112,17 +111,20 @@ def load_example():
|
|
| 112 |
|
| 113 |
# Fallback to GitHub raw URL if no local file found
|
| 114 |
if df is None:
|
| 115 |
-
url = "https://raw.githubusercontent.com/othmanreem/Data-intensive-systems/main/
|
| 116 |
print(f"Loading dataset from {url}")
|
| 117 |
df = pd.read_csv(url)
|
| 118 |
|
| 119 |
# Get a random row with only the features we need
|
| 120 |
available_features = [f for f in FEATURE_NAMES if f in df.columns]
|
|
|
|
| 121 |
sample = df[available_features].sample(1).values[0]
|
| 122 |
# Convert to float list to ensure proper types for Gradio sliders
|
| 123 |
return [float(x) for x in sample]
|
| 124 |
except Exception as e:
|
| 125 |
print(f"Error loading example: {e}")
|
|
|
|
|
|
|
| 126 |
return [0.5] * len(FEATURE_NAMES)
|
| 127 |
|
| 128 |
|
|
|
|
| 97 |
|
| 98 |
try:
|
| 99 |
possible_paths = [
|
| 100 |
+
"Datasets_all/A2_dataset_80.csv",
|
| 101 |
"A2/A2_dataset.csv",
|
|
|
|
| 102 |
"../Datasets_all/A2_dataset_80.csv",
|
| 103 |
]
|
| 104 |
|
|
|
|
| 111 |
|
| 112 |
# Fallback to GitHub raw URL if no local file found
|
| 113 |
if df is None:
|
| 114 |
+
url = "https://raw.githubusercontent.com/othmanreem/Data-intensive-systems/main/Datasets_all/A2_dataset_80.csv"
|
| 115 |
print(f"Loading dataset from {url}")
|
| 116 |
df = pd.read_csv(url)
|
| 117 |
|
| 118 |
# Get a random row with only the features we need
|
| 119 |
available_features = [f for f in FEATURE_NAMES if f in df.columns]
|
| 120 |
+
print(f"Found {len(available_features)} matching features")
|
| 121 |
sample = df[available_features].sample(1).values[0]
|
| 122 |
# Convert to float list to ensure proper types for Gradio sliders
|
| 123 |
return [float(x) for x in sample]
|
| 124 |
except Exception as e:
|
| 125 |
print(f"Error loading example: {e}")
|
| 126 |
+
import traceback
|
| 127 |
+
traceback.print_exc()
|
| 128 |
return [0.5] * len(FEATURE_NAMES)
|
| 129 |
|
| 130 |
|