File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,10 @@ def parse_data_to_record_dict(record_chunk):
126
126
print ("Running attribute calculation." )
127
127
calculated_attribute_by_record_id = {}
128
128
idx = 0
129
- progress_size = 100
130
129
amount = len (record_dict_list )
131
- current_progress = 0.0
132
- __print_progress (current_progress )
130
+ progress_size = min (100 , amount // 10 )
131
+ processed_records = 0
132
+ __print_progress (processed_records / amount )
133
133
134
134
async def process_llm_record_batch (record_dict_batch : list ):
135
135
"""Process a batch of record_dicts, writes results into shared var calculated_attribute_by_record_id."""
@@ -148,10 +148,10 @@ async def process_llm_record_batch(record_dict_batch: list):
148
148
f"{ str (py_data_types ) if len (py_data_types ) > 1 else str (py_data_types [0 ])} ."
149
149
)
150
150
calculated_attribute_by_record_id [record_dict ["id" ]] = attr_value
151
-
152
- global current_progress
153
- current_progress = current_progress + len ( record_dict_batch ) / amount
154
- __print_progress (round (current_progress , 2 ))
151
+ global processed_records
152
+ processed_records = processed_records + 1
153
+ if processed_records % progress_size == 0 :
154
+ __print_progress (round (processed_records / amount , 2 ))
155
155
156
156
async def process_async_llm_calls (record_dict_list ):
157
157
batch_size = max (
You can’t perform that action at this time.
0 commit comments