fix: format lint (#316)
This commit is contained in:
@@ -5,4 +5,5 @@ __version__ = importlib.metadata.version(__package__ or __name__)
|
|||||||
from embedchain.apps.App import App # noqa: F401
|
from embedchain.apps.App import App # noqa: F401
|
||||||
from embedchain.apps.CustomApp import CustomApp # noqa: F401
|
from embedchain.apps.CustomApp import CustomApp # noqa: F401
|
||||||
from embedchain.apps.OpenSourceApp import OpenSourceApp # noqa: F401
|
from embedchain.apps.OpenSourceApp import OpenSourceApp # noqa: F401
|
||||||
from embedchain.apps.PersonApp import PersonApp, PersonOpenSourceApp # noqa: F401
|
from embedchain.apps.PersonApp import (PersonApp, # noqa: F401
|
||||||
|
PersonOpenSourceApp)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Iterable, List, Union
|
from typing import List
|
||||||
|
|
||||||
from langchain.schema import BaseMessage
|
from langchain.schema import BaseMessage
|
||||||
|
|
||||||
from embedchain.config import ChatConfig, CustomAppConfig, OpenSourceAppConfig
|
from embedchain.config import ChatConfig, CustomAppConfig
|
||||||
from embedchain.embedchain import EmbedChain
|
from embedchain.embedchain import EmbedChain
|
||||||
from embedchain.models import Providers
|
from embedchain.models import Providers
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
from typing import Iterable, List, Union
|
from typing import Iterable, Union
|
||||||
|
|
||||||
from embedchain.config import ChatConfig, OpenSourceAppConfig
|
from embedchain.config import ChatConfig, OpenSourceAppConfig
|
||||||
from embedchain.embedchain import EmbedChain
|
from embedchain.embedchain import EmbedChain
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ from embedchain.apps.App import App
|
|||||||
from embedchain.apps.OpenSourceApp import OpenSourceApp
|
from embedchain.apps.OpenSourceApp import OpenSourceApp
|
||||||
from embedchain.config import ChatConfig, QueryConfig
|
from embedchain.config import ChatConfig, QueryConfig
|
||||||
from embedchain.config.apps.BaseAppConfig import BaseAppConfig
|
from embedchain.config.apps.BaseAppConfig import BaseAppConfig
|
||||||
from embedchain.config.QueryConfig import DEFAULT_PROMPT, DEFAULT_PROMPT_WITH_HISTORY
|
from embedchain.config.QueryConfig import (DEFAULT_PROMPT,
|
||||||
|
DEFAULT_PROMPT_WITH_HISTORY)
|
||||||
|
|
||||||
|
|
||||||
class EmbedChainPersonApp:
|
class EmbedChainPersonApp:
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import logging
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from chromadb.api.types import Documents, Embeddings
|
from chromadb.api.types import Documents, Embeddings
|
||||||
@@ -7,7 +6,6 @@ from dotenv import load_dotenv
|
|||||||
from embedchain.models import EmbeddingFunctions, Providers
|
from embedchain.models import EmbeddingFunctions, Providers
|
||||||
|
|
||||||
from .BaseAppConfig import BaseAppConfig
|
from .BaseAppConfig import BaseAppConfig
|
||||||
from embedchain.models import Providers
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ class OpenSourceAppConfig(BaseAppConfig):
|
|||||||
:param id: Optional. ID of the app. Document metadata will have this id.
|
:param id: Optional. ID of the app. Document metadata will have this id.
|
||||||
:param host: Optional. Hostname for the database server.
|
:param host: Optional. Hostname for the database server.
|
||||||
:param port: Optional. Port for the database server.
|
:param port: Optional. Port for the database server.
|
||||||
:param model: Optional. GPT4ALL uses the model to instantiate the class. So unlike `App`, it has to be provided before querying.
|
:param model: Optional. GPT4ALL uses the model to instantiate the class.
|
||||||
|
So unlike `App`, it has to be provided before querying.
|
||||||
"""
|
"""
|
||||||
self.model = model or "orca-mini-3b.ggmlv3.q4_0.bin"
|
self.model = model or "orca-mini-3b.ggmlv3.q4_0.bin"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from chromadb.errors import InvalidDimensionException
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from langchain.docstore.document import Document
|
from langchain.docstore.document import Document
|
||||||
from langchain.memory import ConversationBufferMemory
|
from langchain.memory import ConversationBufferMemory
|
||||||
@@ -10,8 +11,6 @@ from embedchain.config.apps.BaseAppConfig import BaseAppConfig
|
|||||||
from embedchain.config.QueryConfig import DOCS_SITE_PROMPT_TEMPLATE
|
from embedchain.config.QueryConfig import DOCS_SITE_PROMPT_TEMPLATE
|
||||||
from embedchain.data_formatter import DataFormatter
|
from embedchain.data_formatter import DataFormatter
|
||||||
|
|
||||||
from chromadb.errors import InvalidDimensionException
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
ABS_PATH = os.getcwd()
|
ABS_PATH = os.getcwd()
|
||||||
@@ -164,7 +163,7 @@ class EmbedChain:
|
|||||||
except InvalidDimensionException as e:
|
except InvalidDimensionException as e:
|
||||||
raise InvalidDimensionException(
|
raise InvalidDimensionException(
|
||||||
e.message()
|
e.message()
|
||||||
+ ". This is commonly a side-effect when an embedding function, different from the one used to add the embeddings, is used to retrieve an embedding from the database."
|
+ ". This is commonly a side-effect when an embedding function, different from the one used to add the embeddings, is used to retrieve an embedding from the database." # noqa E501
|
||||||
) from None
|
) from None
|
||||||
|
|
||||||
results_formatted = self._format_result(result)
|
results_formatted = self._format_result(result)
|
||||||
|
|||||||
Reference in New Issue
Block a user