Spaces:
Sleeping
Sleeping
Commit
·
7da9aa9
1
Parent(s):
d7e002e
updates
Browse files
app.py
CHANGED
|
@@ -25,14 +25,15 @@ try:
|
|
| 25 |
dataset = load_dataset(dataset_name, split="train")
|
| 26 |
print("Loaded existing dataset:", dataset)
|
| 27 |
print("Dataset features:", dataset.features) # Check if 'split' is part of features
|
| 28 |
-
|
|
|
|
| 29 |
# Check if the 'split' column exists; if not, add it
|
| 30 |
if 'split' not in dataset.column_names:
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
split_values = [
|
| 35 |
-
"dev" if
|
| 36 |
for example in dataset
|
| 37 |
]
|
| 38 |
|
|
|
|
| 25 |
dataset = load_dataset(dataset_name, split="train")
|
| 26 |
print("Loaded existing dataset:", dataset)
|
| 27 |
print("Dataset features:", dataset.features) # Check if 'split' is part of features
|
| 28 |
+
|
| 29 |
+
|
| 30 |
# Check if the 'split' column exists; if not, add it
|
| 31 |
if 'split' not in dataset.column_names:
|
| 32 |
+
match = re.search(r'_(\d+)\.', example["image_id"])
|
| 33 |
+
image_id = match.group(1).lstrip('0')
|
| 34 |
+
|
| 35 |
split_values = [
|
| 36 |
+
"dev" if image_id in results else "train"
|
| 37 |
for example in dataset
|
| 38 |
]
|
| 39 |
|