This message was deleted.
# ask-for-help
s
This message was deleted.
🏁 1
🍱 1
a
can you install bentoml from pip instead of conda? we don’t currently maintain the conda package for bentoml and it is outdated with the most current release.
r
I did pip install bentoml
a
can you send the whole trace stack here?
r
what do you mean
a
I mean the output on the terminal when you run
bentoml serve service.py:svc
r
(base) C:\Users\dimi\bento_deploy>bentoml serve service.py:svc C\Users\dimi\anaconda3\lib\site packages\paramiko\transport.py219: CryptographyDeprecationWarning: Blowfish has been deprecated "class": algorithms.Blowfish, 2022-10-20T001524+0300 [INFO] [cli] Prometheus metrics for HTTP BentoServer from "service.py:svc" can be accessed at http://localhost:3000/metrics. 2022-10-20T001525+0300 [INFO] [cli] Starting development HTTP BentoServer from "service.py:svc" running on http://0.0.0.0:3000 (Press CTRL+C to quit)
a
can you share your service code?
r
Copy code
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']

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"}
a
next time you can use triple backticks to format the code block 😄
Copy code
this is using triple backtick
This warning is not related to bentoml then