fix: building mpt dependencies

Signed-off-by: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
aarnphm-ec2-dev
2023-07-11 00:21:23 +00:00
parent 61bfd64bd5
commit c2bb29b4f3
4 changed files with 12 additions and 7 deletions

View File

@@ -2056,9 +2056,8 @@ def prune_command(yes: bool, model_store: ModelStore = Provide[BentoMLContainer.
"""Remove all saved models locally."""
available = [
m
for t in map(inflection.dasherize, openllm.CONFIG_MAPPING.keys())
for m in bentoml.models.list()
if t in m.tag.name
if 'framework' in m.info.labels and m.info.labels['framework'] == 'openllm'
]
for model in available:

View File

@@ -230,6 +230,8 @@ def make_attr_tuple_class(cls_name: str, attr_names: t.Sequence[str]):
__slots__ = ()
x = property(itemgetter(0))
"""
from . import SHOW_CODEGEN
attr_class_name = f"{cls_name}Attributes"
attr_class_template = [
f"class {attr_class_name}(tuple):",
@@ -241,7 +243,11 @@ def make_attr_tuple_class(cls_name: str, attr_names: t.Sequence[str]):
else:
attr_class_template.append(" pass")
globs: DictStrAny = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
if SHOW_CODEGEN:
logger.info("Generated class for %s:\n\n%s", attr_class_name, "\n".join(attr_class_template))
_compile_and_eval("\n".join(attr_class_template), globs)
return globs[attr_class_name]