Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@danielezhu
Copy link
Contributor

Description of changes:
See title. This PR also fixes a bug introduced in the previous PR where the invoke_model call in BertScore was not replaced with get_helper_scores.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

class TestSummarizationAccuracySemanticRobustness:
@pytest.mark.parametrize(
"config, expected_evaluate_sample_scores, expected_evaluate_scores",
"config, evaluate_sample_scores, evaluate_scores",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that as with GSR, I have verified that the SASR logic remains the same as before by temporarily using the old numpy APIs in the semantic perturbation code, and then running the test cases using the old expected scores.

self._bertscore = hf_evaluate.load("bertscore")
self._model_type = model_type

# Dummy call to download the model within constructor
Copy link
Contributor Author

@danielezhu danielezhu Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting this b/c loading the model into memory during the evaluate_sample integ tests causes codebuild integ tests to fail (the job just hangs/crashes). Note that I never had any issues locally, even with a several year old macbook pro.

Note that this doesn't impact the correctness of the algo/helper model at all, as we're going to call compute "for real" when we obtain the first scores anyways.

"Missing required input: model_input, for SummarizationAccuracySemanticRobustness evaluate_sample",
)
util.require(
transforms = get_model_responses_from_perturbed_inputs(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I left this extraneous variable in from my old code. I will get rid of it in a followup PR, as we need to get the other PRs for the rest of the algos merged asap.

@danielezhu danielezhu merged commit 5c931fe into aws:main Mar 27, 2024
@danielezhu danielezhu deleted the sasr branch March 27, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants