Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,7 +94,37 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 94 |
# Filter the dataset to include ONLY the target task ID
|
| 95 |
# This uses the 'filter' method available on Hugging Face datasets.
|
| 96 |
#subset = dataset.filter(lambda example: example['task_id'] in target_task_ids)
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
results_log = []
|
| 100 |
answers_payload = []
|
|
|
|
| 94 |
# Filter the dataset to include ONLY the target task ID
|
| 95 |
# This uses the 'filter' method available on Hugging Face datasets.
|
| 96 |
#subset = dataset.filter(lambda example: example['task_id'] in target_task_ids)
|
| 97 |
+
specific_target_ids = [
|
| 98 |
+
'e1fc63a2-da7a-432f-be78-7c4a95598703',
|
| 99 |
+
'a1e91b78-d3d8-4675-bb8d-62741b4b68a6',
|
| 100 |
+
'4fc2f1ae-8625-45b5-ab34-ad4433bc21f8',
|
| 101 |
+
'8e867cd7-cff9-4e6c-867a-ff5ddc2550be',
|
| 102 |
+
'ec09fa32-d03f-4bf8-84b0-1f16922c3ae4',
|
| 103 |
+
'2d83110e-a098-4ebb-9987-066c06fa42d0',
|
| 104 |
+
'5cfb274c-0207-4aa7-9575-6ac0bd95d9b2',
|
| 105 |
+
'27d5d136-8563-469e-92bf-fd103c28b57c',
|
| 106 |
+
'dc28cf18-6431-458b-83ef-64b3ce566c10',
|
| 107 |
+
'42576abe-0deb-4869-8c63-225c2d75a95a'
|
| 108 |
+
]
|
| 109 |
+
# --- END SPECIFIC TARGET IDS ---
|
| 110 |
+
|
| 111 |
+
# 1. Get the list of Task IDs from the slice (indices 20 to 50)
|
| 112 |
+
# We must fetch the task_id column data specifically.
|
| 113 |
+
sliced_ids = dataset.select(range(20, 51))['task_id']
|
| 114 |
+
|
| 115 |
+
# 2. Combine the sliced IDs with the specific IDs into a single set for uniqueness
|
| 116 |
+
# This ensures we don't accidentally duplicate tasks if some specific IDs are in the slice range.
|
| 117 |
+
all_unique_target_ids = set(sliced_ids)
|
| 118 |
+
all_unique_target_ids.update(specific_target_ids)
|
| 119 |
+
all_unique_target_ids_list = list(all_unique_target_ids)
|
| 120 |
+
|
| 121 |
+
print(f"Total unique tasks to run: {len(all_unique_target_ids_list)}")
|
| 122 |
+
|
| 123 |
+
# 3. Filter the original dataset using the complete list of unique IDs
|
| 124 |
+
# This replaces the need for complex concatenation.
|
| 125 |
+
subset = dataset.filter(lambda example: example['task_id'] in all_unique_target_ids_list)
|
| 126 |
+
subset = subset.to_list()
|
| 127 |
+
|
| 128 |
|
| 129 |
results_log = []
|
| 130 |
answers_payload = []
|