This message was deleted.
# ask-for-help
s
This message was deleted.
f
If I remove the import for JsonSerializable, the error won't occur, but of course it still won't serve because then JsonInput won't be defined. Any idea what I'm doing wrong here?
f
Hello, I think the docs you are looking is old.
I think you may follow here.
f
Thank you! I'll check it out
@FIRAT TAMUR according to that doc there should be a Json IO Descriptor available for import from bentoml.io, but it still fails when trying to import it
cannot import name 'Json' from '<http://bentoml.io|bentoml.io>'
f
Could you please try JSON?
f
on it
Ah okay, that does the trick
1
Can I treat that like the standard json datatype in python and convert it to a numpy array so I can preprocess the data?
f
For that case I think there is another data type
f
Yeah, but I need to receive the data in Json format, but still perform preprocessing on it
f
do you have an example?
f
the request will certainly be sent in Json format. Since I'm not very experienced with Json but still need to scale the values received to fit into the range the model was trained on i'd like to convert the input to numpy, scale the values and then pass it to the model runner
Do you think it might be easier scaling the inputs before sending the request?
f
No, I think the backend should hold the logic instead of the front end, so the processing should happen after the request is received.
f
Yeah I'd think so too. Any idea how I'd convert it from the input type to a numpy array?
f
Maybe something like this? I am not sure I hope it helps
f
that looks very promising!