-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests/test_classifiers.py
PyTests
#421
Conversation
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
tests/test_classifiers.py
Outdated
hugging_face_api_token = os.getenv("HUGGING_FACE_API_TOKEN") | ||
if not hugging_face_api_token: | ||
pytest.fail("HUGGING_FACE_API_TOKEN environment variable not set") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We grab the Hugging Face token here instead of using a @pytest.fixture
. The reason for this is that if we used a PyTest fixture and the test failed for whatever reason, the Hugging Face token would be exposed in the logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is not a short term fix here, we can probably skip this test using skipif
.
@pytest.mark.skipif(
not os.getenv("HUGGING_FACE_API_TOKEN"),
reason="HUGGING_FACE_API_TOKEN environment variable is not set"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thanks a ton for adding these tests @sarahyurick .
I think we should be good to merge this once we resolve how to pass in HF Secret
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
expected_pred = cudf.DataFrame( | ||
{ | ||
"constraint_ct": [0.5586], | ||
"contextual_knowledge": [0.0559], | ||
"creativity_scope": [0.0825], | ||
"domain_knowledge": [0.9803], | ||
"no_label_reason": [0.0], | ||
"number_of_few_shots": [0], | ||
"prompt_complexity_score": [0.2783], | ||
"reasoning": [0.0632], | ||
"task_type_1": ["Code Generation"], | ||
"task_type_2": ["Text Generation"], | ||
"task_type_prob": [0.767], | ||
"text": text, | ||
} | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This passes on my remote machine (both my conda setup and my Docker setup) but is failing on our gpuCI. I think perhaps it is related to floating point errors on different machines? I will probably just add some rounding estimations so that it passes both locally for me and here on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @VibhuJawa
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Signed-off-by: Sarah Yurick <[email protected]>
Closes #405.
Closes #419.