-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Have components auto run warm_up on first use instead of erroring when not pre-warmed up #10181
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
releasenotes/notes/refactor-warm-up-components-c2777fef28a70b61.yaml
Outdated
Show resolved
Hide resolved
|
Seems like the test: def test_raises_component_error_if_model_not_warmed_up(self):in It's a false positive - the test passes for the wrong reason, the model is being warmed up, but warm-up fails because HTTP is blocked I removed the line |
|
On another topic, I think if self.model is None:
self.warm_up()
# To make mypy happy even though this is set in warm_up()
assert self.model is not NoneIMO, adding a We are using a runtime safety tool (assert) to solve a type checker analysis problem (mypy limitations). I think those are different things that shouldn't be mixed. Also, if the assumption is somehow broken, an In any case I don't think the PR should be blocked by this, but I would be happy to hear what you think about it. |
…1.yaml Co-authored-by: David S. Batista <[email protected]>
Yeah I was unsure how to proceed on this. For this PR I followed what we've done in other parts of the code base which was use assert statements, but I'd also be fine with using type ignore instead. @anakin87 I'd appreciate your thoughts on this as well. |
It's a nuanced topic and I don't have strong opinions about. Sometimes having an I'm also OK with using a |
Sounds good! I'll go ahead and update the PR to use |
|
@davidsbatista this should be ready for a final review, all added asserts should have been removed! |
Related Issues
warm_upat runtime #9966Proposed Changes:
This PR updates components to auto run their warm_up method on first use. Pipelines already warm up components at runtime, so standalone use should follow the same pattern for a smoother developer experience.
How did you test it?
Updated existing tests
Notes for the reviewer
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.