Spaces:
Paused
Paused
fix
Browse files
app.py
CHANGED
|
@@ -74,7 +74,7 @@ def update_snapshot(username):
|
|
| 74 |
|
| 75 |
output_dir = snapshot_download(
|
| 76 |
repo_id="taesiri/imagenet_hard_review_data",
|
| 77 |
-
allow_patterns=
|
| 78 |
repo_type="dataset",
|
| 79 |
)
|
| 80 |
files = glob(f"{output_dir}/*.json")
|
|
@@ -89,23 +89,8 @@ def update_snapshot(username):
|
|
| 89 |
rows.append(tdf)
|
| 90 |
|
| 91 |
df = pd.DataFrame(rows, columns=columns)
|
| 92 |
-
|
| 93 |
-
# download and append all CSV files
|
| 94 |
-
output_dir = snapshot_download(
|
| 95 |
-
repo_id="taesiri/imagenet_hard_review_data_r3",
|
| 96 |
-
allow_patterns="*.csv",
|
| 97 |
-
repo_type="dataset",
|
| 98 |
-
)
|
| 99 |
-
files = glob(f"{output_dir}/*.csv")
|
| 100 |
-
|
| 101 |
-
if len(files) > 0:
|
| 102 |
-
csv_dataframes = [pd.read_csv(file) for file in files]
|
| 103 |
-
csv_dataframes = pd.concat(csv_dataframes, ignore_index=True)
|
| 104 |
-
df = pd.concat([df, csv_dataframes], ignore_index=True)
|
| 105 |
-
|
| 106 |
-
# remove duplicate rows
|
| 107 |
-
df = df.drop_duplicates(subset=["id", "user_id"], keep="last")
|
| 108 |
df = df[df["user_id"] == username]
|
|
|
|
| 109 |
return df
|
| 110 |
|
| 111 |
|
|
|
|
| 74 |
|
| 75 |
output_dir = snapshot_download(
|
| 76 |
repo_id="taesiri/imagenet_hard_review_data",
|
| 77 |
+
allow_patterns=pattern,
|
| 78 |
repo_type="dataset",
|
| 79 |
)
|
| 80 |
files = glob(f"{output_dir}/*.json")
|
|
|
|
| 89 |
rows.append(tdf)
|
| 90 |
|
| 91 |
df = pd.DataFrame(rows, columns=columns)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
df = df[df["user_id"] == username]
|
| 93 |
+
|
| 94 |
return df
|
| 95 |
|
| 96 |
|