Add flavor details to model cmds

Change-Id: Idb468ecb6875125fac7e7ecd9d037e2c9d666551
This commit is contained in:
bharath 2018-11-06 17:21:40 +05:30
parent 1f417ba48c
commit dea07ad935
2 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,7 @@ class ModelManager(base.Manager):
new = {}
new["name"] = kwargs["name"]
new["type"] = kwargs["type"]
new["flavor_id"] = kwargs["flavor_id"]
model = self._create(self._path(), new)
upload_trained_model = kwargs['trained_model']
return self._create_and_upload(self._path(model.id)+'/upload_trained_model', upload_trained_model)

View File

@ -86,6 +86,9 @@ def do_model_list(cs, args):
@utils.arg('name',
metavar='<name>',
help='ID or name of the model to train')
@utils.arg('--flavor-id',
metavar='<flavor_id>',
help='ID or name of the model to train')
@utils.arg('--trained-model',
metavar='<trained_model>',
help='Absolute path for trained models')
@ -97,6 +100,7 @@ def do_create_model(cs, args):
opts = {}
opts['name'] = args.name
opts['type'] = args.type
opts["flavor_id"] = args.flavor_id
opts = gyan_utils.remove_null_parms(**opts)
try:
opts['trained_model'] = open(args.trained_model, 'rb').read()