Skip to content
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

reset stats + cache before running #91

Merged
merged 1 commit into from
Feb 6, 2025
Merged

reset stats + cache before running #91

merged 1 commit into from
Feb 6, 2025

Conversation

StanChan03
Copy link
Collaborator

resetting cache before the test is run

@StanChan03 StanChan03 linked an issue Jan 26, 2025 that may be closed by this pull request
@@ -540,6 +540,9 @@ def test_disable_operator_cache(setup_models, model):
lm = LM(model="gpt-4o-mini", cache=cache)
lotus.settings.configure(lm=lm, enable_cache=False)

lm.reset_cache()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why this does not clear the cache properly?

Copy link
Collaborator Author

@StanChan03 StanChan03 Jan 26, 2025

Choose a reason for hiding this comment

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

Oh I think its because when we initialize our model in the tests, I am defining it as lm=LM(model='gpt-40-mini', cache=cache) rather than lm = setup_models[model] since we needed to include the cache arg. So the lm instance may not be using the def print_usage_after_each_test(setup_models):

Copy link
Collaborator

@sidjha1 sidjha1 left a comment

Choose a reason for hiding this comment

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

Approved with one question: is the lm.reset_stats necessary for the tests to pass?

@sidjha1 sidjha1 marked this pull request as ready for review February 6, 2025 04:32
@StanChan03 StanChan03 merged commit 0accdd3 into main Feb 6, 2025
6 checks passed
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.

failing cache test
2 participants