使用多卡单线程

This commit is contained in:
2024-07-06 17:20:09 +08:00
parent 4b31fc52d5
commit 33e3472fa2
2 changed files with 9 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ SETTLEMENT_IE = Taskflow("information_extraction", schema=keys.SETTLEMENT_LIST_S
task_path="config/model/settlement_list_model", layout_analysis=False) task_path="config/model/settlement_list_model", layout_analysis=False)
DISCHARGE_IE = Taskflow("information_extraction", schema=keys.DISCHARGE_RECORD_SCHEMA, model="uie-x-base", DISCHARGE_IE = Taskflow("information_extraction", schema=keys.DISCHARGE_RECORD_SCHEMA, model="uie-x-base",
task_path="config/model/discharge_record_model", layout_analysis=False) task_path="config/model/discharge_record_model", layout_analysis=False)
COST_IE = Taskflow("information_extraction", schema=keys.COST_LIST_SCHEMA, model="uie-x-base", COST_IE = Taskflow("information_extraction", schema=keys.COST_LIST_SCHEMA, model="uie-x-base", device_id=1,
task_path="config/model/cost_list_model", layout_analysis=False) task_path="config/model/cost_list_model", layout_analysis=False)
OCR = PaddleOCR(use_angle_cls=False, lang="ch", show_log=False) OCR = PaddleOCR(use_angle_cls=False, lang="ch", show_log=False)

View File

@@ -416,14 +416,14 @@ def photo_review(pk_phhd):
elif phrec.cRectype == "4": elif phrec.cRectype == "4":
cost_list.append(phrec) cost_list.append(phrec)
with concurrent.futures.ThreadPoolExecutor() as executor: # with concurrent.futures.ThreadPoolExecutor() as executor:
executor.submit(settlement_task, pk_phhd, settlement_list) # executor.submit(settlement_task, pk_phhd, settlement_list)
executor.submit(discharge_task, pk_phhd, discharge_record) # executor.submit(discharge_task, pk_phhd, discharge_record)
# executor.submit(settlement_and_discharge_task, pk_phhd, settlement_list, discharge_record) # # executor.submit(settlement_and_discharge_task, pk_phhd, settlement_list, discharge_record)
executor.submit(cost_task, pk_phhd, cost_list) # executor.submit(cost_task, pk_phhd, cost_list)
# settlement_task(pk_phhd, settlement_list) settlement_task(pk_phhd, settlement_list)
# discharge_task(pk_phhd, discharge_record) discharge_task(pk_phhd, discharge_record)
# cost_task(pk_phhd, cost_list) cost_task(pk_phhd, cost_list)
def main(): def main():