Spaces:
Sleeping
Sleeping
Amol Kaushik commited on
Commit ·
41f2e62
1
Parent(s): c08e529
Fix load_example to fetch from GitHub URL on HuggingFace
Browse files
app.py
CHANGED
|
@@ -107,7 +107,14 @@ def load_example():
|
|
| 107 |
for path in possible_paths:
|
| 108 |
if os.path.exists(path):
|
| 109 |
df = pd.read_csv(path)
|
|
|
|
| 110 |
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
# Get a random row with only the features we need
|
| 113 |
available_features = [f for f in FEATURE_NAMES if f in df.columns]
|
|
|
|
| 107 |
for path in possible_paths:
|
| 108 |
if os.path.exists(path):
|
| 109 |
df = pd.read_csv(path)
|
| 110 |
+
print(f"Loaded dataset from {path}")
|
| 111 |
break
|
| 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/A2/A2_dataset.csv"
|
| 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]
|