This message was deleted.
# ask-for-help
s
This message was deleted.
j
Copy code
bentoml serve analytics:latest                                      1 ↵  1348  13:30:16
Error: [bentoml-cli] `serve` failed: Failed to load bento or import service 'analytics:latest'.
If you are attempting to import bento in local store: 'Attribute "latest" not found in module "analytics".'.
If you are importing by python module path: 'no Models with name 'cpu_utilization_model_arima' exist in BentoML store <osfs '/Users/jaydeepsamanta/bentoml/bentos/analytics/ghdwc5tmd2dhvury/models'>'.
v
what's the output of
bentoml models list
?
j
Copy code
Tag                                                       Module                   Size        Creation Time       
 cpu_utilization_model_xgb:4wgjc4dmdoomtury                bentoml.xgboost          1.50 MiB    2023-10-16 13:02:36 
 cpu_utilization_model_arima:4wamujtmdkk7pury              bentoml.picklable_model  1.65 MiB    2023-10-16 12:55:27
I see 2 models but when I build a bento that is when I get error
c
Hi @Jaydeep Samanta - are you using a custom runner?
Could you try add the
models
field to your
bentofile.yaml
? see: https://docs.bentoml.com/en/latest/concepts/bento.html#models
j
Hi Chaoyu, I was able to fix this one, yes I am using a custom runner as I am using statsmodel(ARIMA) which is currently not supported in bentoml. Basically, I had to init local runner and that worked for me.
🙌 1
c
Hi @Jaydeep Samanta - init local runner may not be the most efficient way to do this, BentoML may still spin a separate process for the runner but it won’t be utilized at all. You can use the
embedded runner
option, or add the runner instance to the bentoml.Service’s runners list
👍 1
happy to help take a look if you could share the code 😄
j
Thanks! Sure i will give it a try with
embedded runner
Cheers!
Hi @Chaoyu,I looked in the document but did not find any specific tutorial to use
embedded runner
, if you could point me one that would be really helpful. Also I tried the other option adding my custom runner instance to bentoml.Service's runner list but then I get the same error before, I do not see that model appearing in the bento
Copy code
Building BentoML service "analytics:kspkrjtos2izjury" from build context 
Packing model "cpu_utilization_model_xgb:ebpiutdmh6l65ury"
Copy code
I expect something like below:
Copy code
Packing model "cpu_utilization_model_arima:gumpddtmh6m5lury"
Packing model "cpu_utilization_model_xgb:ebpiutdmh6l65ury"
j
Hey Jaydeep! you can find the embedded runner docs here. https://docs.bentoml.org/en/latest/concepts/runner.html#embedded-runners
j
Thank you @Jian Shen Yap! I will have a look at this.
j
for a custom Runner, you can do this
Copy code
class SimpleRunnable(bentoml.Runnable):
    SUPPORTED_RESOURCES = ("cpu",)
    SUPPORTS_CPU_MULTI_THREADING = True

    @bentoml.Runnable.method()
    def predict(self, inputs: str) -> tuple[np.array, np.array, np.array]:
        return np.array([1,2,3]), np.array([4,5,6]), np.array([7,8,9])
        # return f"{inputs}"
    
simple_runner = bentoml.Runner(SimpleRunnable, embedded=True)
j
Hi @Jian Shen Yap @Chaoyu, I would like to push above code to BentoML repo as I believe it would be a nice guide to someone exploring time series models with custom runner implementation for models like ARIMA, RIVER, could you please guide on where to begin with? Should I open a feature support request issue tracker in git to begin with? Kind regards, Jaydeep