Skip to content

Commit 92a5912

Browse files
fix: update progress tracking in LLM record processing
1 parent 24d83d8 commit 92a5912

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

run_ac.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def parse_data_to_record_dict(record_chunk):
128128
idx = 0
129129
progress_size = 100
130130
amount = len(record_dict_list)
131-
__print_progress(0.0)
131+
current_progress = 0.0
132+
__print_progress(current_progress)
132133

133134
async def process_llm_record_batch(record_dict_batch: list):
134135
"""Process a batch of record_dicts, writes results into shared var calculated_attribute_by_record_id."""
@@ -148,6 +149,10 @@ async def process_llm_record_batch(record_dict_batch: list):
148149
)
149150
calculated_attribute_by_record_id[record_dict["id"]] = attr_value
150151

152+
global current_progress
153+
current_progress = current_progress + len(record_dict_batch) / amount
154+
__print_progress(round(current_progress, 2))
155+
151156
async def process_async_llm_calls(record_dict_list):
152157
batch_size = max(
153158
len(record_dict_list) // int(attribute_calculators.NUM_WORKERS_A2VYBG), 1

0 commit comments

Comments
 (0)