Slackbot
01/11/2023, 6:34 PMAaron Pham
01/11/2023, 8:12 PMAaron Pham
01/11/2023, 8:13 PM__call__
and `predict`( which is a proxy to __call__
) for inference.Aaron Pham
01/11/2023, 8:13 PMBrandon Biggs
01/11/2023, 8:13 PMpredict.run(str)
Aaron Pham
01/11/2023, 8:14 PMAaron Pham
01/11/2023, 8:14 PM__call__
as entrypoint, the runner will convert it to .run
and .async_run
Aaron Pham
01/11/2023, 8:14 PMrunner.__call__.run
Brandon Biggs
01/11/2023, 8:15 PMAaron Pham
01/11/2023, 8:16 PMbento_model = bentoml.transformers.save_model("gpt2-pipeline", pipe)
runner = bentoml.transformers.get(bento_model.tag).to_runner()
runner.init_local()
runner.run("hello world")
Brandon Biggs
01/11/2023, 8:18 PMBrandon Biggs
01/11/2023, 8:18 PM>>> gpt2.run("hi", max_new_tokens=100)
Brandon Biggs
01/11/2023, 8:19 PM