Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions kag/common/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def load_config(prod: bool = False, config_file: str = None):
if not validate_config_file(config_file):
config_file = _closest_cfg()
if os.path.exists(config_file) and os.path.isfile(config_file):
logger.info(f"found config file: {config_file}")
logger.debug(f"found config file: {config_file}")
with open(config_file, "r") as reader:
config = reader.read()
config = Template(config).render(**dict(os.environ))
Expand Down Expand Up @@ -181,9 +181,9 @@ def init_log_config(self, config):
def initialize(self, prod: bool = True, config_file: str = None):
config = load_config(prod, config_file)
if self._is_initialized:
logger.info("WARN: Reinitialize the KAG configuration.")
logger.info(f"original config: {self.config}\n\n")
logger.info(f"new config: {config}")
logger.debug("WARN: Reinitialize the KAG configuration.")
logger.debug(f"original config: {self.config}\n\n")
logger.debug(f"new config: {config}")
self.prod = prod
self.config = config
global_config = self.config.get(KAGConstants.PROJECT_CONFIG_KEY, {})
Expand Down Expand Up @@ -261,6 +261,5 @@ def init_env(config_file: str = None):
os.environ[KAGConstants.ENV_KAG_PROJECT_HOST_ADDR] = str(KAG_PROJECT_CONF.host_addr)
if len(KAG_CONFIG.all_config) > 0:
dump_flag = os.getenv(KAGConstants.ENV_KAG_DEBUG_DUMP_CONFIG)
pprint.pprint(KAG_CONFIG.all_config, indent=2)
if dump_flag is not None and dump_flag.strip() == "1":
pprint.pprint(KAG_CONFIG.all_config, indent=2)
72 changes: 0 additions & 72 deletions kag/examples/baike/schema/index.schema

This file was deleted.

Empty file.
19 changes: 17 additions & 2 deletions kag/indexer/kag_index_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,17 @@ def description(self) -> str:
@property
def schema(self) -> str:
return """
Chunk(文本块): IndexType
properties:
content(内容): Text
index: TextAndVector
AtomicQuery(原子问): IndexType
properties:
title(标题): Text
index: TextAndVector
relations:
sourceChunk(关联文本块): Chunk
similar(相似问题): AtomicQuery
relatedTo(相关): KnowledgeUnit
similar(相似问题): AtomicQuery
"""

@property
Expand Down Expand Up @@ -292,6 +295,10 @@ def description(self) -> str:
@property
def schema(self) -> str:
return """
Chunk(文本块): IndexType
properties:
content(内容): Text
index: TextAndVector
Table(表格): IndexType
properties:
content(内容): Text
Expand Down Expand Up @@ -374,6 +381,10 @@ def description(self) -> str:
@property
def schema(self) -> str:
return """
Chunk(文本块): IndexType
properties:
content(内容): Text
index: TextAndVector
Summary(文本摘要): IndexType
properties:
content(内容): Text
Expand Down Expand Up @@ -453,6 +464,10 @@ def description(self) -> str:
@property
def schema(self) -> str:
return """
Chunk(文本块): IndexType
properties:
content(内容): Text
index: TextAndVector
Outline(标题大纲): IndexType
properties:
content(内容): Text
Expand Down
72 changes: 0 additions & 72 deletions kag/open_benchmark/2wiki/schema/index.schema

This file was deleted.

72 changes: 0 additions & 72 deletions kag/open_benchmark/hotpotqa/schema/index.schema

This file was deleted.

72 changes: 0 additions & 72 deletions kag/open_benchmark/musique/schema/index.schema

This file was deleted.

5 changes: 0 additions & 5 deletions kag/templates/schema/{{default}}.schema.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
namespace {{namespace}}

Chunk(文本块): EntityType
properties:
content(内容): Text
index: TextAndVector

ArtificialObject(人造物体): EntityType
properties:
desc(描述): Text
Expand Down
Loading
Loading