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

Skip to content

Conversation

@danielezhu
Copy link
Contributor

@danielezhu danielezhu commented Feb 9, 2024

Description of changes:

After PR #180, we've been consistently running into issues where pip installing fmeval from pypi within the example notebooks (this installation is always included as the first cell of the notebooks) is causing dependency version issues that cause the test_custom_model_hf_notebook test to fail.

Specifically, tokenizers is getting re-installed to be a lower version (0.12.1) that is used by the current release of fmeval , but transformers somehow isn't also getting re-installed to its lower version (4.22.1); it's still 4.37.2 as dictated by pyproject.toml.

This PR updates the example notebook unit tests so that they do not install fmeval from pypi. Rather they will continue to use the fmeval package installed by poetry during poetry install, i.e. the same fmeval package that the rest of the unit tests run against.

In order to accomplish this desired behavior, I have updated the unit tests to skip the execution of the first code cell.
The for loop that iterates through tb.cells and runs execute_cell() is directly copied from the body of execute(); I simply added a couple lines of extra logic to skip the first code cell.

While this is a bit hacky, the testbook library doesn't provide a good way to skip cells that get run during the test (there is a way to specify cells to run before the test, but that's not what we want to do).

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

oyangz
oyangz previously approved these changes Feb 9, 2024
@oyangz
Copy link
Contributor

oyangz commented Feb 9, 2024

Thanks for fixing the issue!

xiaoyi-cheng
xiaoyi-cheng previously approved these changes Feb 9, 2024
@xiaoyi-cheng xiaoyi-cheng changed the title [fix] Fix example notebook unit tests fix: Fix example notebook unit tests Feb 9, 2024
@danielezhu danielezhu dismissed stale reviews from xiaoyi-cheng and oyangz via 422f0c6 February 9, 2024 20:55
@danielezhu danielezhu merged commit 7017146 into aws:main Feb 9, 2024
@danielezhu danielezhu deleted the fix_unit_tests branch February 9, 2024 21:55
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