diff --git a/chatchat-server/chatchat/configs/__init__.py b/chatchat-server/chatchat/configs/__init__.py index 6e964622..c943cb39 100644 --- a/chatchat-server/chatchat/configs/__init__.py +++ b/chatchat-server/chatchat/configs/__init__.py @@ -32,12 +32,13 @@ def _import_config_mod_load(import_config_mod: str) -> Dict: file_names = os.listdir(user_config_path) - if (import_config_mod + ".py",) not in file_names: + if import_config_mod + ".py" not in file_names: logger.warning( f"Missing {file_names}.py file in {user_config_path}, Skip." ) user_import = False if user_import: + # Dynamic loading {config}.py file py_path = os.path.join(user_config_path, import_config_mod + ".py") spec = importlib.util.spec_from_file_location( @@ -54,7 +55,10 @@ def _import_config_mod_load(import_config_mod: str) -> Dict: "module": module, } - except ImportError: + except ImportError as e: + logger.error( + f"Failed to load user config from {user_config_path}, Skip.", e + ) pass else: user_import = False @@ -613,4 +617,4 @@ __all__ = [ "API_SERVER", -] \ No newline at end of file +] diff --git a/chatchat-server/pyproject.toml b/chatchat-server/pyproject.toml index 4416f428..c9273b7d 100644 --- a/chatchat-server/pyproject.toml +++ b/chatchat-server/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain-chatchat" -version = "0.3.0" +version = "0.3.0.20240506" description = "" authors = ["chatchat"] readme = "README.md" @@ -247,4 +247,4 @@ ignore-words-list = 'momento,collison,ned,foor,reworkd,parth,whats,aapply,mysogy #[[tool.poetry.source]] #name = "tsinghua" #url = "https://pypi.tuna.tsinghua.edu.cn/simple/" -#priority = "default" \ No newline at end of file +#priority = "default"