Skip to content

Commit eed97ed

Browse files
Update class_file_manager.py
Enhanced the JSON validation error dialogs for Classification file managers by appending modality-specific Hugging Face download links to guide users to the correct dataset formats.
1 parent 6275ef4 commit eed97ed

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

annotation_tool/controllers/classification/class_file_manager.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ def load_project(self, data, file_path):
2424
# Truncate extremely long error messages for display
2525
if len(err) > 1000:
2626
err = err[:1000] + "\n... (truncated)"
27+
28+
error_text = (
29+
"The imported JSON contains critical errors and cannot be loaded.\n\n"
30+
f"{err}\n\n"
31+
"--------------------------------------------------\n"
32+
"💡 Please download the correct Classification JSON format from:\n"
33+
"https://huggingface.co/datasets/OpenSportsLab/soccernetpro-classification-vars"
34+
)
2735

2836
QMessageBox.critical(
2937
self.main,
3038
"Validation Error (Classification)",
31-
"The imported JSON contains critical errors and cannot be loaded.\n\n" + err
39+
error_text
3240
)
3341
return False # [FIX] Return False to signal failure
3442

@@ -241,4 +249,4 @@ def _clear_workspace(self, full_reset=False):
241249
self.ui.classification_ui.right_panel.manual_box.setEnabled(False)
242250
self.ui.classification_ui.center_panel.show_single_view(None)
243251
if full_reset:
244-
self.main.setup_dynamic_ui()
252+
self.main.setup_dynamic_ui()

0 commit comments

Comments
 (0)