This message was deleted.
# ask-for-help
s
This message was deleted.
l
Copy code
2022-11-07T15:43:08+0100 [DEBUG] [cli] Importing service "service:svc" from working dir: "/Users/lz/***/***/***/Scripts/deployment"
2022-11-07T15:43:10+0100 [DEBUG] [cli] Default runner method set to 'predict', it can be accessed both via 'runner.run' and 'runner.predict.async_run'.
2022-11-07T15:43:10+0100 [DEBUG] [cli] 'predict_product_type' imported from source: bentoml.Service(name="predict_product_type", import_str="service:svc", working_dir="/Users/lz/***/***/***/Scripts/deployment")
2022-11-07T15:43:11+0100 [INFO] [cli] Prometheus metrics for HTTP BentoServer from "service:svc" can be accessed at <http://localhost:3002/metrics>.
2022-11-07T15:43:11+0100 [DEBUG] [cli] --reload is passed. BentoML will watch file changes based on 'bentofile.yaml' and '.bentoignore' respectively.
2022-11-07T15:43:12+0100 [INFO] [cli] Registering signals...
2022-11-07T15:43:15+0100 [INFO] [cli] Starting master on pid 21102
2022-11-07T15:43:15+0100 [DEBUG] [cli] Socket bound at 0.0.0.0:3002 - fd: 4
2022-11-07T15:43:15+0100 [INFO] [cli] sockets started
2022-11-07T15:43:15+0100 [DEBUG] [cli] Initializing watchers
2022-11-07T15:43:15+0100 [DEBUG] [cli] cmd: /Users/lz/miniconda3/bin/python -c 'from circus import plugins;plugins.main()' --endpoint <tcp://127.0.0.1:63760> --pubsub <tcp://127.0.0.1:63761> --config bentoml_home:/Users/lz/bentoml:::working_dir:/Users/lz/***/***/***/Scripts/deployment --log-level DEBUG bentoml._internal.utils.circus.watchfilesplugin.ServiceReloaderPlugin
2022-11-07T15:43:15+0100 [DEBUG] [cli] args: None
2022-11-07T15:43:15+0100 [DEBUG] [cli] process args: ['/Users/lz/miniconda3/bin/python', '-c', 'from circus import plugins;plugins.main()', '--endpoint', '<tcp://127.0.0.1:63760>', '--pubsub', '<tcp://127.0.0.1:63761>', '--config', 'bentoml_home:/Users/lz/bentoml:::working_dir:/Users/lz/***/***/***/Scripts/deployment', '--log-level', 'DEBUG', 'bentoml._internal.utils.circus.watchfilesplugin.ServiceReloaderPlugin']
2022-11-07T15:43:15+0100 [DEBUG] [cli] running bentoml._internal.utils.circus.watchfilesplugin.ServiceReloaderPlugin process [pid 21167]
2022-11-07T15:43:15+0100 [INFO] [cli] Arbiter now waiting for commands
2022-11-07T15:43:15+0100 [INFO] [cli] bentoml._internal.utils.circus.watchfilesplugin.ServiceReloaderPlugin started
2022-11-07T15:43:15+0100 [DEBUG] [cli] cmd: /Users/lz/miniconda3/bin/python
2022-11-07T15:43:15+0100 [DEBUG] [cli] args: ['-m', 'bentoml_cli.worker.http_dev_api_server', 'service:svc', '--fd', '$(circus.sockets._bento_api_server)', '--working-dir', '/Users/lz/***/***/***/Scripts/deployment', '--prometheus-dir', '/Users/lz/bentoml/prometheus_multiproc_dir']
2022-11-07T15:43:15+0100 [DEBUG] [cli] process args: ['/Users/lz/miniconda3/bin/python', '-m', 'bentoml_cli.worker.http_dev_api_server', 'service:svc', '--fd', '4', '--working-dir', '/Users/lz/***/***/***/Scripts/deployment', '--prometheus-dir', '/Users/lz/bentoml/prometheus_multiproc_dir']
2022-11-07T15:43:15+0100 [DEBUG] [cli] running dev_api_server process [pid 21168]
2022-11-07T15:43:15+0100 [INFO] [cli] dev_api_server started
2022-11-07T15:43:15+0100 [INFO] [cli] Starting development HTTP BentoServer from "service:svc" listening on <http://0.0.0.0:3002> (Press CTRL+C to quit)
2022-11-07 15:43:19 circus[21167] [INFO] Loading the plugin...
2022-11-07 15:43:19 circus[21167] [INFO] Endpoint: '<tcp://127.0.0.1:63760>'
2022-11-07 15:43:19 circus[21167] [INFO] Pub/sub: '<tcp://127.0.0.1:63761>'
2022-11-07T15:43:19+0100 [INFO] [observer] BentoML is installed via development mode, adding source root to 'watch_dirs'.
2022-11-07T15:43:19+0100 [INFO] [observer] Watching directories: ['/Users/lz/***/***/***/Scripts/deployment', '/Users/lz/bentoml/models', '/Users/lz/miniconda3/lib/python3.8/site-packages/bentoml']
2022-11-07T15:43:19+0100 [DEBUG] [dev_api_server] Importing service "service:svc" from working dir: "/Users/lz/***/***/***/Scripts/deployment"
2022-11-07T15:43:20+0100 [DEBUG] [dev_api_server] Default runner method set to 'predict', it can be accessed both via 'runner.run' and 'runner.predict.async_run'.
2022-11-07T15:43:20+0100 [DEBUG] [dev_api_server] 'predict_product_type' imported from source: bentoml.Service(name="predict_product_type", import_str="service:svc", working_dir="/Users/lz/***/***/***/Scripts/deployment")
2022-11-07T15:44:31+0100 [DEBUG] [cli] reaping process 21168 [dev_api_server]
2022-11-07T15:44:31+0100 [DEBUG] [cli] cmd: /Users/lz/miniconda3/bin/python
2022-11-07T15:44:31+0100 [DEBUG] [cli] args: ['-m', 'bentoml_cli.worker.http_dev_api_server', 'service:svc', '--fd', '$(circus.sockets._bento_api_server)', '--working-dir', '/Users/lz/***/***/***/Scripts/deployment', '--prometheus-dir', '/Users/lz/bentoml/prometheus_multiproc_dir']
2022-11-07T15:44:31+0100 [DEBUG] [cli] process args: ['/Users/lz/miniconda3/bin/python', '-m', 'bentoml_cli.worker.http_dev_api_server', 'service:svc', '--fd', '4', '--working-dir', '/Users/lz/***/***/***/Scripts/deployment', '--prometheus-dir', '/Users/lz/bentoml/prometheus_multiproc_dir']
2022-11-07T15:44:31+0100 [DEBUG] [cli] running dev_api_server process [pid 21447]
2022-11-07T15:44:35+0100 [DEBUG] [dev_api_server] Importing service "service:svc" from working dir: "/Users/lz/***/***/***/Scripts/deployment"
2022-11-07T15:44:36+0100 [DEBUG] [dev_api_server] Default runner method set to 'predict', it can be accessed both via 'runner.run' and 'runner.predict.async_run'.
2022-11-07T15:44:36+0100 [DEBUG] [dev_api_server] 'predict_product_type' imported from source: bentoml.Service(name="predict_product_type", import_str="service:svc", working_dir="/Users/lz/***/***/***/Scripts/deployment")
a
Hi there, can you send me your service definition?
l
@Aaron Pham Sure 👍 I kept making the service simpler to try and track down what was happening. This is the simple version that still triggers the same error:
Copy code
import typing
from typing import TYPE_CHECKING, Any, Optional
from numpy.typing import NDArray
import bentoml
from <http://bentoml.io|bentoml.io> import JSON, NumpyNdarray, Text
from pydantic import BaseModel
import pandas as pd
import numpy as np
import json


## Defining runner
classifier_runner = bentoml.sklearn.get("production_product_type_classifier_model:latest").to_runner()
svc = bentoml.Service("predict_product_type", runners=[classifier_runner])


## Defining API
@svc.api(
    input = NumpyNdarray(), 
    output = NumpyNdarray()
    )
def predict(input_data:  NDArray[Any]) -> NDArray[Any]:
    result = classifier_runner.predict.run(input_data)
    return result