fix: Fix example notebook unit tests #188
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
After PR #180, we've been consistently running into issues where pip installing
fmevalfrom pypi within the example notebooks (this installation is always included as the first cell of the notebooks) is causing dependency version issues that cause thetest_custom_model_hf_notebooktest to fail.Specifically,
tokenizersis getting re-installed to be a lower version (0.12.1) that is used by the current release offmeval, buttransformerssomehow isn't also getting re-installed to its lower version (4.22.1); it's still4.37.2as dictated bypyproject.toml.This PR updates the example notebook unit tests so that they do not install
fmevalfrom pypi. Rather they will continue to use thefmevalpackage installed by poetry duringpoetry install, i.e. the samefmevalpackage 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.cellsand runsexecute_cell()is directly copied from the body ofexecute(); 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.