mirror of
https://github.com/jiaxiaojunQAQ/OmniSafeBench-MM.git
synced 2026-07-10 23:13:45 +02:00
test: add test for per-attack image directories and improve error handling
- Add test_generate_test_cases.py to verify each attack uses its own image directory - Improve error messages in unified_registry for failed imports with more context - Add null checks in generate_test_cases.py for attack initialization failures - Reduce excessive max_tokens in judge_utils from 130000 to 10000 for efficiency - Add missing ThreadPoolExecutor import in qr/attack.py - Fix missing newline in pyproject.toml
This commit is contained in:
@@ -154,8 +154,10 @@ class UnifiedRegistry:
|
||||
)
|
||||
return cls
|
||||
except (ImportError, AttributeError) as e:
|
||||
self.logger.debug(
|
||||
f"Unable to import {type_name} '{name}' from mapping: {e}"
|
||||
self.logger.warning(
|
||||
f"Failed to import {type_name} '{name}': {e}. "
|
||||
f"This usually means missing dependencies. "
|
||||
f"Module: {module_path}, Class: {class_name}"
|
||||
)
|
||||
return None
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user