From f6da992b3e520fbd4e588e3dd3e41c8d4ff0641b Mon Sep 17 00:00:00 2001 From: James Collins Date: Sat, 8 Jul 2023 09:27:43 -0700 Subject: [PATCH] Drop AbstractSingleton as a parent class of the vector memory (#4901) * Drop AbstractSingleton as a parent class of the vector memory * Forgot pytest fixture in integration tests * Revert typo --- autogpt/memory/vector/providers/base.py | 3 +-- tests/integration/memory/test_json_file_memory.py | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/autogpt/memory/vector/providers/base.py b/autogpt/memory/vector/providers/base.py index dc4dbf3c..aa233228 100644 --- a/autogpt/memory/vector/providers/base.py +++ b/autogpt/memory/vector/providers/base.py @@ -6,13 +6,12 @@ import numpy as np from autogpt.config.config import Config from autogpt.logs import logger -from autogpt.singleton import AbstractSingleton from .. import MemoryItem, MemoryItemRelevance from ..utils import Embedding, get_embedding -class VectorMemoryProvider(MutableSet[MemoryItem], AbstractSingleton): +class VectorMemoryProvider(MutableSet[MemoryItem]): @abc.abstractmethod def __init__(self, config: Config): pass diff --git a/tests/integration/memory/test_json_file_memory.py b/tests/integration/memory/test_json_file_memory.py index e60a0766..38cd26c8 100644 --- a/tests/integration/memory/test_json_file_memory.py +++ b/tests/integration/memory/test_json_file_memory.py @@ -8,12 +8,6 @@ from autogpt.memory.vector import JSONFileMemory, MemoryItem from autogpt.workspace import Workspace -@pytest.fixture(autouse=True) -def cleanup_sut_singleton(): - if JSONFileMemory in JSONFileMemory._instances: - del JSONFileMemory._instances[JSONFileMemory] - - def test_json_memory_init_without_backing_file(config: Config, workspace: Workspace): index_file = workspace.root / f"{config.memory_index}.json"