From 62acf2b3c70f6ee0ded5a0221a95c89e813ff9a1 Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 7 Nov 2023 16:37:56 -0500 Subject: [PATCH] clean up unused code Former-commit-id: 7a5e82b8955d13acf5ec8229346426e124d41a4d --- pyproject.toml | 2 +- swarms/tools/mm_models.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81b197d49..f829bf41f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "2.0.3" +version = "2.0.4" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "] diff --git a/swarms/tools/mm_models.py b/swarms/tools/mm_models.py index 0b1cd281e..e8da2e5c7 100644 --- a/swarms/tools/mm_models.py +++ b/swarms/tools/mm_models.py @@ -19,13 +19,12 @@ ) from swarms.prompts.prebuild.multi_modal_prompts import IMAGE_PROMPT -from swarms.tools.base import tool -from swarms.tools.main import BaseToolSet +from swarms.tools.tool import tool from swarms.utils.logger import logger from swarms.utils.main import BaseHandler, get_new_image_name -class MaskFormer(BaseToolSet): +class MaskFormer: def __init__(self, device): print("Initializing MaskFormer to %s" % device) self.device = device @@ -61,7 +60,7 @@ def inference(self, image_path, text): return image_mask.resize(original_image.size) -class ImageEditing(BaseToolSet): +class ImageEditing: def __init__(self, device): print("Initializing ImageEditing to %s" % device) self.device = device @@ -116,7 +115,7 @@ def inference_replace(self, inputs): return updated_image_path -class InstructPix2Pix(BaseToolSet): +class InstructPix2Pix: def __init__(self, device): print("Initializing InstructPix2Pix to %s" % device) self.device = device @@ -156,7 +155,7 @@ def inference(self, inputs): return updated_image_path -class Text2Image(BaseToolSet): +class Text2Image: def __init__(self, device): print("Initializing Text2Image to %s" % device) self.device = device @@ -190,7 +189,7 @@ def inference(self, text): return image_filename -class VisualQuestionAnswering(BaseToolSet): +class VisualQuestionAnswering: def __init__(self, device): print("Initializing VisualQuestionAnswering to %s" % device) self.torch_dtype = torch.float16 if "cuda" in device else torch.float32