-
Notifications
You must be signed in to change notification settings - Fork 456
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
Load errors with flair should now be generating proper API errors. #121
Conversation
@@ -37,7 +37,7 @@ | |||
} | |||
|
|||
|
|||
@functools.cache | |||
@functools.lru_cache() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiangolo only supports 3.8, and that's equivalent.
@@ -1,5 +1,6 @@ | |||
import logging | |||
import os | |||
import functools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix style, this is not sorted properly
(I see that the automatic check is not checking this directory. I'll send a PR to fix)
model_id = os.environ["MODEL_ID"] | ||
|
||
app.pipeline = get_pipeline(task, model_id) | ||
app.get_pipeline = get_pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need this below? (just as in #123)
try:
get_pipeline()
except Exception:
# We can fail so we can show exception later.
pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will help usage a bit, not a strict requirement.
With this, starlette will load the model form the start, without it it will load it when first request hits.
(It's only memory load, it will already be on disk because of prestart.sh
)
No description provided.