Skip to content

serving keras runner with two Input() layer #2491

Answered by parano
cchrkoc asked this question in General
Discussion options

You must be logged in to vote

Hi @cchrkoc - Multi input models are well supported in BentoML.

If you don't need adaptive batching for your use case, you can save your model again with batchable=False signature (with the new 1.0.0rc1 release):

bentoml.keras.save_model("same_model:latest", model_inst, signatures={'predict': {'batchable': False}})

keras_runner = bentoml.keras.get("same_model:latest").to_runner()
keras_runner.init_local()

dummy_token = np.zeros((1, 512))
dummy_mask = np.zeros((1, 512))
res = keras_runner.predict.run([dummy_token, dummy_mask])

It is also possible to do adaptive batching on both inputs. In your case, the input batch dimension should be set to 1, since the first dimension is always 2 (cont…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cchrkoc
Comment options

@parano
Comment options

@cchrkoc
Comment options

@parano
Comment options

@parano
Comment options

Answer selected by cchrkoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants