Revert "make the docstring more readable and improve the list_models logic"

This reverts commit 248068fe5d.
This commit is contained in:
Lincoln Stein 2022-11-26 12:57:47 -05:00
parent 9e0504abe5
commit 7f3ba16cd2

View File

@ -125,18 +125,15 @@ class ModelCache(object):
def list_models(self) -> dict:
'''
Return a dict of models in the format:
{
model_name1: {
'status': ('active'|'cached'|'not loaded'),
'description': description,
},
model_name2: { etc },
}
{ model_name1: {'status': ('active'|'cached'|'not loaded'),
'description': description,
},
model_name2: { etc }
'''
models = {}
for name, config in self.config.items():
result = dict()
for name in self.config:
try:
description = config.description
description = self.config[name].description
except ConfigAttributeError:
description = '<no description>'
@ -147,13 +144,11 @@ class ModelCache(object):
else:
status = 'not loaded'
models = models.update(
name = {
'status': status,
'description': description,
})
return models
result[name]={
'status' : status,
'description' : description
}
return result
def print_models(self) -> None:
'''