Skip to content

model-server-worker fails without "optional" arguments #909

@johncolby

Description

@johncolby

Small bug in model-server-worker, which fails if the optional arguments handler, model-path, or model-name are not provided.

docstring:

Usage: model-server-worker [-h] --sock-type {unix,tcp} [--sock-name SOCK_NAME]
                           [--host HOST] [--port PORT] [--handler HANDLER]
                           [--model-path MODEL_PATH] [--model-name MODEL_NAME]
                           --preload-model PRELOAD_MODEL --tmp-dir TMP_DIR

When debugging custom service code, I usually invoke the model-server-worker manually like:

python model_service_worker.py --sock-type unix --sock-name /tmp/.mms.sock.9000 --preload-model false --tmp-dir /tmp

However, this fails under 1.1.0 due to the recent addition of the following argument encoding code, which fails when any of these arguments are None type:

model_req["handler"] = args.handler.encode('utf-8')
model_req["modelPath"] = args.model_path.encode('utf-8')
model_req["modelName"] = args.model_name.encode('utf-8')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions