Skip to content
Prev Previous commit
Correcting feature_ready test for usage of huggingface models.
  • Loading branch information
millianlmx committed Aug 27, 2024
commit 74c7aa5af0558f4e7f4d6fbfec2d1b0c5330ca88
9 changes: 8 additions & 1 deletion detect_secrets/filters/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ def is_feature_enabled() -> bool:

def is_feature_ready(args: Namespace) -> bool:
try:
return type(args.huggingface_model and args.threshold and args.huggingface_token) is bool
temp = vars(args)
answer = True

entries = ['huggingface_model', 'threshold', 'huggingface_token']
for entry in entries:
answer = answer and temp[entry] is not None

return answer
except Exception:
return False

Expand Down