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