Skip to content

Commit

Permalink
feat(translator): optimize thread executor configuration for better Q…
Browse files Browse the repository at this point in the history
…PS management
  • Loading branch information
awwaawwa committed Jan 26, 2025
1 parent 4b78b2d commit acc4380
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yadt/document_il/midend/il_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def translate(self, docs: Document):
self.stage_name, total
) as pbar:
with concurrent.futures.ThreadPoolExecutor(
max_workers=self.translation_config.qps * 2
max_workers=min(self.translation_config.qps * 2, self.translation_config.qps + 5)
) as executor:
for page in docs.page:
self.process_page(page, executor, pbar, tracker.new_page())
Expand Down

0 comments on commit acc4380

Please sign in to comment.