From 141a23fb1e8277cbda8ec5d2f3cde1e3fdeecf56 Mon Sep 17 00:00:00 2001 From: Deshraj Yadav Date: Sun, 26 Nov 2023 15:44:06 -0800 Subject: [PATCH] [BugFix] Skip checking thread when making sqlite connection (#978) --- embedchain/apps/app.py | 3 ++- embedchain/embedchain.py | 3 ++- embedchain/memory/base.py | 2 +- embedchain/pipeline.py | 1 - pyproject.toml | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/embedchain/apps/app.py b/embedchain/apps/app.py index b61acbe7..15ba4e1d 100644 --- a/embedchain/apps/app.py +++ b/embedchain/apps/app.py @@ -2,7 +2,8 @@ from typing import Optional import yaml -from embedchain.config import AppConfig, BaseEmbedderConfig, BaseLlmConfig, ChunkerConfig +from embedchain.config import (AppConfig, BaseEmbedderConfig, BaseLlmConfig, + ChunkerConfig) from embedchain.config.vectordb.base import BaseVectorDbConfig from embedchain.embedchain import EmbedChain from embedchain.embedder.base import BaseEmbedder diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index 863bf1e7..dfd1627e 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -16,7 +16,8 @@ from embedchain.embedder.base import BaseEmbedder from embedchain.helpers.json_serializable import JSONSerializable from embedchain.llm.base import BaseLlm from embedchain.loaders.base_loader import BaseLoader -from embedchain.models.data_type import DataType, DirectDataType, IndirectDataType, SpecialDataType +from embedchain.models.data_type import (DataType, DirectDataType, + IndirectDataType, SpecialDataType) from embedchain.telemetry.posthog import AnonymousTelemetry from embedchain.utils import detect_datatype, is_valid_json_string from embedchain.vectordb.base import BaseVectorDB diff --git a/embedchain/memory/base.py b/embedchain/memory/base.py index d3386664..d80cf779 100644 --- a/embedchain/memory/base.py +++ b/embedchain/memory/base.py @@ -23,7 +23,7 @@ CHAT_MESSAGE_CREATE_TABLE_QUERY = """ class ECChatMemory: def __init__(self) -> None: - with sqlite3.connect(SQLITE_PATH) as self.connection: + with sqlite3.connect(SQLITE_PATH, check_same_thread=False) as self.connection: self.cursor = self.connection.cursor() self.cursor.execute(CHAT_MESSAGE_CREATE_TABLE_QUERY) diff --git a/embedchain/pipeline.py b/embedchain/pipeline.py index e370faa4..8a922fe1 100644 --- a/embedchain/pipeline.py +++ b/embedchain/pipeline.py @@ -23,7 +23,6 @@ from embedchain.utils import validate_yaml_config from embedchain.vectordb.base import BaseVectorDB from embedchain.vectordb.chroma import ChromaDB - # Setup the user directory if doesn't exist already Client.setup_dir() diff --git a/pyproject.toml b/pyproject.toml index 9c039de3..b6b49a10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "embedchain" -version = "0.1.21" +version = "0.1.22" description = "Data platform for LLMs - Load, index, retrieve and sync any unstructured data" authors = [ "Taranjeet Singh ",