From 05e89b67e39f3ee25d2c70bea00cef26fd628cfc Mon Sep 17 00:00:00 2001 From: Joseph Catrambone Date: Thu, 31 Oct 2024 10:59:34 -0700 Subject: [PATCH] Fix linting complaints. --- validator/main.py | 2 +- validator/post-install.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/validator/main.py b/validator/main.py index ab14baf..7253fc6 100644 --- a/validator/main.py +++ b/validator/main.py @@ -46,7 +46,7 @@ def __init__( # There are some spurious loading complaints with TFDistilBert models. # See https://discuss.huggingface.co/t/message-some-layers-from-the-model-were-not-used/1972/7 - def validate(self, value: Any, metadata: Dict = None) -> ValidationResult: + def validate(self, value: Any, metadata: Optional[Dict] = None) -> ValidationResult: """Validates that the text is free from biases related to age, gender, sex, ethnicity, religion, etc.""" if isinstance(value, str): value = [value,] # Ensure we're always passing lists of strings into the classifier. diff --git a/validator/post-install.py b/validator/post-install.py index b6ae976..f4879ff 100644 --- a/validator/post-install.py +++ b/validator/post-install.py @@ -1,4 +1,4 @@ -print("post-install starting...") from transformers import pipeline +print("post-install starting...") _ = pipeline("text-classification", "d4data/bias-detection-model") print("post-install complete!") \ No newline at end of file