ai4os / DEEPaaS

A REST API to serve machine learning and deep learning models
https://deepaas.readthedocs.io
Apache License 2.0
35 stars 15 forks source link

deepaas-cli always expects get_predict_args() and get_train_args() #189

Open vykozlov opened 3 days ago

vykozlov commented 3 days ago

Description

Some AI models provide only prediction, therefore "get_train_args()" function does not exist. It does not cause an error in deepaas-run but deepaas-cli by default always expects both of the "get_train_args()" and "get_predict_args()" to be present.

Steps to Reproduce

  1. in a AI module comment "get_train_args()"
  2. call deepaas-cli predict --help
  3. see error as e.g.
    train_args = _fields_to_dict(model_obj.get_train_args())
                                ^^^^^^^^^^^^^^^^^^^^^^^^
    AttributeError: module 'zooprocess_multiple_separator.api' has no attribute 'get_train_args'. Did you mean: 'get_predict_args'?

Expected behavior:

deepaas-cli is able to deal with cases when only predict() or train() is available

Versions

DEEPaaS API 2.5.2 and earlier