[Bug fix] Fix issues related to logging configuration (#1318)
This commit is contained in:
@@ -91,6 +91,7 @@ keys = console
|
|||||||
keys = generic
|
keys = generic
|
||||||
|
|
||||||
[logger_root]
|
[logger_root]
|
||||||
|
level = WARN
|
||||||
handlers = console
|
handlers = console
|
||||||
qualname =
|
qualname =
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,14 @@ import requests
|
|||||||
import yaml
|
import yaml
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
from embedchain.cache import (Config, ExactMatchEvaluation,
|
from embedchain.cache import (
|
||||||
SearchDistanceEvaluation, cache,
|
Config,
|
||||||
gptcache_data_manager, gptcache_pre_function)
|
ExactMatchEvaluation,
|
||||||
|
SearchDistanceEvaluation,
|
||||||
|
cache,
|
||||||
|
gptcache_data_manager,
|
||||||
|
gptcache_pre_function,
|
||||||
|
)
|
||||||
from embedchain.client import Client
|
from embedchain.client import Client
|
||||||
from embedchain.config import AppConfig, CacheConfig, ChunkerConfig
|
from embedchain.config import AppConfig, CacheConfig, ChunkerConfig
|
||||||
from embedchain.core.db.database import get_session, init_db, setup_engine
|
from embedchain.core.db.database import get_session, init_db, setup_engine
|
||||||
@@ -20,8 +25,7 @@ from embedchain.embedchain import EmbedChain
|
|||||||
from embedchain.embedder.base import BaseEmbedder
|
from embedchain.embedder.base import BaseEmbedder
|
||||||
from embedchain.embedder.openai import OpenAIEmbedder
|
from embedchain.embedder.openai import OpenAIEmbedder
|
||||||
from embedchain.evaluation.base import BaseMetric
|
from embedchain.evaluation.base import BaseMetric
|
||||||
from embedchain.evaluation.metrics import (AnswerRelevance, ContextRelevance,
|
from embedchain.evaluation.metrics import AnswerRelevance, ContextRelevance, Groundedness
|
||||||
Groundedness)
|
|
||||||
from embedchain.factory import EmbedderFactory, LlmFactory, VectorDBFactory
|
from embedchain.factory import EmbedderFactory, LlmFactory, VectorDBFactory
|
||||||
from embedchain.helpers.json_serializable import register_deserializable
|
from embedchain.helpers.json_serializable import register_deserializable
|
||||||
from embedchain.llm.base import BaseLlm
|
from embedchain.llm.base import BaseLlm
|
||||||
@@ -83,12 +87,10 @@ class App(EmbedChain):
|
|||||||
if name and config:
|
if name and config:
|
||||||
raise Exception("Cannot provide both name and config. Please provide only one of them.")
|
raise Exception("Cannot provide both name and config. Please provide only one of them.")
|
||||||
|
|
||||||
logger.debug("4.0")
|
|
||||||
# Initialize the metadata db for the app
|
# Initialize the metadata db for the app
|
||||||
setup_engine(database_uri=os.environ.get("EMBEDCHAIN_DB_URI"))
|
setup_engine(database_uri=os.environ.get("EMBEDCHAIN_DB_URI"))
|
||||||
init_db()
|
init_db()
|
||||||
|
|
||||||
logger.debug("4.0")
|
|
||||||
self.auto_deploy = auto_deploy
|
self.auto_deploy = auto_deploy
|
||||||
# Store the dict config as an attribute to be able to send it
|
# Store the dict config as an attribute to be able to send it
|
||||||
self.config_data = config_data if (config_data and validate_config(config_data)) else None
|
self.config_data = config_data if (config_data and validate_config(config_data)) else None
|
||||||
@@ -118,7 +120,6 @@ class App(EmbedChain):
|
|||||||
self.llm = llm or OpenAILlm()
|
self.llm = llm or OpenAILlm()
|
||||||
self._init_db()
|
self._init_db()
|
||||||
|
|
||||||
logger.debug("4.1")
|
|
||||||
# Session for the metadata db
|
# Session for the metadata db
|
||||||
self.db_session = get_session()
|
self.db_session = get_session()
|
||||||
|
|
||||||
@@ -126,7 +127,6 @@ class App(EmbedChain):
|
|||||||
if self.cache_config is not None:
|
if self.cache_config is not None:
|
||||||
self._init_cache()
|
self._init_cache()
|
||||||
|
|
||||||
logger.debug("4.2")
|
|
||||||
# Send anonymous telemetry
|
# Send anonymous telemetry
|
||||||
self._telemetry_props = {"class": self.__class__.__name__}
|
self._telemetry_props = {"class": self.__class__.__name__}
|
||||||
self.telemetry = AnonymousTelemetry(enabled=self.config.collect_metrics)
|
self.telemetry = AnonymousTelemetry(enabled=self.config.collect_metrics)
|
||||||
@@ -337,7 +337,6 @@ class App(EmbedChain):
|
|||||||
:return: An instance of the App class.
|
:return: An instance of the App class.
|
||||||
:rtype: App
|
:rtype: App
|
||||||
"""
|
"""
|
||||||
logger.debug("6")
|
|
||||||
# Backward compatibility for yaml_path
|
# Backward compatibility for yaml_path
|
||||||
if yaml_path and not config_path:
|
if yaml_path and not config_path:
|
||||||
config_path = yaml_path
|
config_path = yaml_path
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
from logging.config import fileConfig
|
|
||||||
|
|
||||||
from alembic import context
|
from alembic import context
|
||||||
from sqlalchemy import engine_from_config, pool
|
from sqlalchemy import engine_from_config, pool
|
||||||
@@ -10,11 +9,6 @@ from embedchain.core.db.models import Base
|
|||||||
# access to the values within the .ini file in use.
|
# access to the values within the .ini file in use.
|
||||||
config = context.config
|
config = context.config
|
||||||
|
|
||||||
# Interpret the config file for Python logging.
|
|
||||||
# This line sets up loggers basically.
|
|
||||||
if config.config_file_name is not None:
|
|
||||||
fileConfig(config.config_file_name)
|
|
||||||
|
|
||||||
target_metadata = Base.metadata
|
target_metadata = Base.metadata
|
||||||
|
|
||||||
# other values from the config, defined by the needs of env.py,
|
# other values from the config, defined by the needs of env.py,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "embedchain"
|
name = "embedchain"
|
||||||
version = "0.1.96"
|
version = "0.1.97"
|
||||||
description = "Simplest open source retrieval(RAG) framework"
|
description = "Simplest open source retrieval(RAG) framework"
|
||||||
authors = [
|
authors = [
|
||||||
"Taranjeet Singh <taranjeet@embedchain.ai>",
|
"Taranjeet Singh <taranjeet@embedchain.ai>",
|
||||||
|
|||||||
Reference in New Issue
Block a user