mirror of
https://github.com/HKUDS/LightRAG.git
synced 2025-11-10 14:54:18 +00:00
Add max_gleaning to env
This commit is contained in:
parent
b32c3825cc
commit
479865a271
@ -58,6 +58,8 @@ SUMMARY_LANGUAGE=English
|
||||
# FORCE_LLM_SUMMARY_ON_MERGE=6
|
||||
### Max tokens for entity/relations description after merge
|
||||
# MAX_TOKEN_SUMMARY=500
|
||||
### Maximum number of entity extraction attempts for ambiguous content
|
||||
# ENTITY_EXTRACT_MAX_GLEANING=1
|
||||
|
||||
### Number of parallel processing documents(Less than MAX_ASYNC/2 is recommended)
|
||||
# MAX_PARALLEL_INSERT=2
|
||||
|
||||
@ -7,6 +7,7 @@ consistency and makes maintenance easier.
|
||||
"""
|
||||
|
||||
# Default values for environment variables
|
||||
DEFAULT_MAX_GLEANING = 1
|
||||
DEFAULT_MAX_TOKEN_SUMMARY = 500
|
||||
DEFAULT_FORCE_LLM_SUMMARY_ON_MERGE = 6
|
||||
DEFAULT_WOKERS = 2
|
||||
|
||||
@ -22,6 +22,7 @@ from typing import (
|
||||
Dict,
|
||||
)
|
||||
from lightrag.constants import (
|
||||
DEFAULT_MAX_GLEANING,
|
||||
DEFAULT_MAX_TOKEN_SUMMARY,
|
||||
DEFAULT_FORCE_LLM_SUMMARY_ON_MERGE,
|
||||
)
|
||||
@ -124,7 +125,9 @@ class LightRAG:
|
||||
# Entity extraction
|
||||
# ---
|
||||
|
||||
entity_extract_max_gleaning: int = field(default=1)
|
||||
entity_extract_max_gleaning: int = field(
|
||||
default=get_env_value("MAX_GLEANING", DEFAULT_MAX_GLEANING, int)
|
||||
)
|
||||
"""Maximum number of entity extraction attempts for ambiguous content."""
|
||||
|
||||
summary_to_max_tokens: int = field(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user