Skip to content

Commit 24d83d8

Browse files
committed
ensure at least 1 worker exists
1 parent bc612d1 commit 24d83d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

run_ac.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ async def process_llm_record_batch(record_dict_batch: list):
149149
calculated_attribute_by_record_id[record_dict["id"]] = attr_value
150150

151151
async def process_async_llm_calls(record_dict_list):
152-
batch_size = len(record_dict_list) // int(
153-
attribute_calculators.NUM_WORKERS_A2VYBG
152+
batch_size = max(
153+
len(record_dict_list) // int(attribute_calculators.NUM_WORKERS_A2VYBG), 1
154154
)
155155
record_dict_batches = [
156156
record_dict_list[i : i + batch_size]

0 commit comments

Comments
 (0)