Skip to content

Additional Decorators for the Model API #1287

Answered by bojiang
jiyer2016 asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, I believe functools.wraps is the right thing to do.

Plus I recommend calling your decorator before bentoml.api like this:

@bentoml.api
@auth 
def predict(self, inputs, tasks):
    pass

The bentoml API hasn't promised any behavior of the decorated function now. But the args that the user API function got are well defined.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jiyer2016
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants