Skip to content

Commit dbdb541

Browse files
fix: stream log to cmd
1 parent 04e928c commit dbdb541

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

graphgen/configs/multi_hop_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ search: # web search configuration
77
enabled: false # whether to enable web search
88
search_types: ["google"] # search engine types, support: google, bing, uniprot, wikipedia
99
quiz_and_judge_strategy: # quiz and test whether the LLM masters the knowledge points
10-
enabled: true
10+
enabled: false
1111
quiz_samples: 2 # number of quiz samples to generate
1212
re_judge: false # whether to re-judge the existing quiz samples
1313
traverse_strategy: # strategy for clustering sub-graphs using comprehension loss

graphgen/operators/traverse_graph.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ def get_average_loss(batch: tuple, loss_strategy: str) -> float:
135135
) / (len(batch[0]) + len(batch[1]))
136136
raise ValueError("Invalid loss strategy")
137137
except Exception as e: # pylint: disable=broad-except
138-
logger.error("Error calculating average loss: %s", e)
138+
logger.warning(
139+
"Loss not found in some nodes or edges, setting loss to -1.0: %s", e
140+
)
139141
return -1.0
140142

141143

webui/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def init_graph_gen(config: dict, env: dict) -> GraphGen:
3838
# Set up working directory
3939
log_file, working_dir = setup_workspace(os.path.join(root_dir, "cache"))
4040

41-
set_logger(log_file, if_stream=False)
41+
set_logger(log_file, if_stream=True)
4242
graph_gen = GraphGen(working_dir=working_dir, config=config)
4343

4444
# Set up LLM clients

0 commit comments

Comments
 (0)