yangdx
commited on
Commit
·
83bf83a
1
Parent(s):
1fcec3e
Optimize pipeline status message
Browse files- lightrag/lightrag.py +7 -0
- lightrag/operate.py +1 -1
lightrag/lightrag.py
CHANGED
@@ -902,6 +902,13 @@ class LightRAG:
|
|
902 |
# Get file path from status document
|
903 |
file_path = getattr(status_doc, "file_path", "unknown_source")
|
904 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
905 |
# Generate chunks from document
|
906 |
chunks: dict[str, Any] = {
|
907 |
compute_mdhash_id(dp["content"], prefix="chunk-"): {
|
|
|
902 |
# Get file path from status document
|
903 |
file_path = getattr(status_doc, "file_path", "unknown_source")
|
904 |
|
905 |
+
async with pipeline_status_lock:
|
906 |
+
log_message = f"Processing file: {file_path}"
|
907 |
+
pipeline_status["history_messages"].append(log_message)
|
908 |
+
log_message = f"Processing d-id: {doc_id}"
|
909 |
+
pipeline_status["latest_message"] = log_message
|
910 |
+
pipeline_status["history_messages"].append(log_message)
|
911 |
+
|
912 |
# Generate chunks from document
|
913 |
chunks: dict[str, Any] = {
|
914 |
compute_mdhash_id(dp["content"], prefix="chunk-"): {
|
lightrag/operate.py
CHANGED
@@ -642,7 +642,7 @@ async def extract_entities(
|
|
642 |
processed_chunks += 1
|
643 |
entities_count = len(maybe_nodes)
|
644 |
relations_count = len(maybe_edges)
|
645 |
-
log_message = f"
|
646 |
logger.info(log_message)
|
647 |
if pipeline_status is not None:
|
648 |
async with pipeline_status_lock:
|
|
|
642 |
processed_chunks += 1
|
643 |
entities_count = len(maybe_nodes)
|
644 |
relations_count = len(maybe_edges)
|
645 |
+
log_message = f"Chk {processed_chunks}/{total_chunks}: extracted {entities_count} Ent + {relations_count} Rel (deduplicated)"
|
646 |
logger.info(log_message)
|
647 |
if pipeline_status is not None:
|
648 |
async with pipeline_status_lock:
|