Slackbot
10/26/2022, 6:14 AMMuhammad Awon
10/26/2022, 7:00 AMbentofile.yaml file is?Muhammad Awon
10/26/2022, 7:20 AMbento build command when you get this error.
Kindly run pwd and paste the output here please.yadwinder kaur
10/26/2022, 4:41 PMMuhammad Awon
10/26/2022, 5:01 PMbentofile.yaml? Maybe we can find something there.yadwinder kaur
10/26/2022, 5:04 PMyadwinder kaur
10/26/2022, 5:07 PMMuhammad Awon
10/26/2022, 5:08 PMbentoml build
bentoml containerize credit_risk_classifier:latestyadwinder kaur
10/26/2022, 5:08 PMyadwinder kaur
10/26/2022, 5:09 PMyadwinder kaur
10/26/2022, 5:10 PMyadwinder kaur
10/26/2022, 5:10 PMyadwinder kaur
10/26/2022, 5:11 PM(base) C:\Users\yadwi\Bento>bentoml containerize credit_risk_classifier:latest
Traceback (most recent call last):
File "C:\Users\yadwi\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\yadwi\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\yadwi\anaconda3\Scripts\bentoml.exe\__main__.py", line 7, in <module>
sys.exit(cli())
File "C:\Users\yadwi\anaconda3\lib\site-packages\click\core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "C:\Users\yadwi\anaconda3\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Users\yadwi\anaconda3\lib\site-packages\click\core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\yadwi\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\yadwi\anaconda3\lib\site-packages\click\core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml_cli\utils.py", line 256, in wrapper
return func(*args, **kwargs)
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml_cli\utils.py", line 230, in wrapper
return_value = func(*args, **kwargs)
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml_cli\utils.py", line 191, in wrapper
return func(*args, **kwargs)
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml_cli\utils.py", line 63, in wrapper
return func(*args, **{k: transformer(v) for k, v in kwargs.items()})
File "C:\Users\yadwi\anaconda3\lib\site-packages\simple_di\__init__.py", line 139, in _
return func(*_inject_args(bind.args), **_inject_kwargs(bind.kwargs))
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml_cli\containerize.py", line 247, in containerize
buildx.health()
File "C:\Users\yadwi\anaconda3\lib\site-packages\bentoml\_internal\utils\buildx.py", line 36, in health
output = subprocess.check_output(cmds)
File "C:\Users\yadwi\anaconda3\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\yadwi\anaconda3\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\yadwi\anaconda3\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\yadwi\anaconda3\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specifiedMuhammad Awon
10/26/2022, 5:13 PMxgboost in the bentofile.yaml file (after scikit-learn and pandas).
Then build and containerizeyadwinder kaur
10/26/2022, 5:16 PMMuhammad Awon
10/26/2022, 5:19 PMyadwinder kaur
10/26/2022, 5:19 PMimport numpy as np
from sklearn.feature_extraction import DictVectorizer
import bentoml
from <http://bentoml.io|bentoml.io> import JSON
model_ref = bentoml.xgboost.get("credit_risk_model:latest")
dv = model_ref.custom_objects['dictVectorizer']
print('model_ref.custom_objects')
model_runner = model_ref.to_runner()
svc = bentoml.Service("credit_risk_classifier", runners=[model_runner])
@svc.api(input=JSON(),output=JSON())
def classify(application_data):
vector = dv.transform(application_data)
prediction = model_runner.predict.run(vector)
print(prediction)
result = prediction[0]
if result > 0.5:
return {"status": "DECLINED"}
elif result > 0.23:
return{"status":"MAYBE"}
else:
return {"status": "Approved"}Muhammad Awon
10/26/2022, 5:21 PMyadwinder kaur
10/26/2022, 5:23 PMyadwinder kaur
10/26/2022, 5:24 PMMuhammad Awon
10/26/2022, 5:24 PMMuhammad Awon
10/26/2022, 5:31 PMdirMuhammad Awon
10/26/2022, 5:40 PMyadwinder kaur
10/26/2022, 6:00 PMMuhammad Awon
10/26/2022, 6:24 PMMuhammad Awon
10/26/2022, 6:26 PMbentoml and bentos directory in the project folder, they were meant to be in the home directory by default in the first place and that's why you are having all these issues. Did you change bentoml path and tried anything different?Muhammad Awon
10/26/2022, 6:46 PMbentoml and bento.odt directories, then build and containerize again. If that doesn't work then you'll have to start with the clean slate by creating new project folder and make sure everything related to bentoml environment and path stays default.yadwinder kaur
10/26/2022, 6:47 PMMuhammad Awon
10/26/2022, 6:52 PMbentoml do the rest.
Every time we run bentoml command in the terminal, it generates bentoml directory in the home directory by default and bento needs to see that folder to interact.Muhammad Awon
10/26/2022, 6:53 PMyadwinder kaur
10/26/2022, 7:05 PMMuhammad Awon
10/26/2022, 7:40 PM