LibRecommender icon indicating copy to clipboard operation
LibRecommender copied to clipboard

modified model with sanic serving

Open samruddha-kf opened this issue 2 years ago • 1 comments

Hi, I needed an extra mapping of items - item_category, which I added as an attribute of the model, which I will be using later to filter the recommendations. Right now I have made no code changes to filter, only added the attribute to the model and saved it. This model after loading with libserving module, I could use with tf_serving method. i.e. I can get the logits outputs with RESTful API tf_serving predict method. But when I try to use the sanic framework to get the n recommendations I am getting an error. The error is at line 182 of tf_deploy.py. The module is not able to load the model. What can I do to rectify this? The sanic framework works when model was not modified.

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://127.0.0.1:8000/tf/recommend Error: raise SanicException( sanic.exceptions.SanicException: Error when requesting TensorFlow Serving model: <bound method ClientResponse.text of <ClientResponse(http://localhost:8501/v1/models/deepfm:predict) [400 Bad Request]> <CIMultiDictProxy('Content-Type': 'application/json', 'Date': 'Sun, 25 Feb 2024 19:21:21 GMT', 'Content-Length': '102')>

samruddha-kf avatar Feb 25 '24 19:02 samruddha-kf

Maybe there is a name conflict. Please provide your code.

You can also print data here to check if it has the correct format.

massquantity avatar Feb 26 '24 13:02 massquantity