From 84a848afe364304e340789c559bbbace43120dfc Mon Sep 17 00:00:00 2001 From: Bram Mittendorff Date: Wed, 21 Aug 2024 13:23:29 +0200 Subject: [PATCH] Updated README.md --- README.md | 2 +- python_gpt_po/po_translator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 63e9389..09273a4 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This Python script provides a convenient tool for translating `.po` files using - `polib` library - `openai` Python package -![gpt-po](https://github.com/pescheckit/python-gpt-po/assets/78353155/d76ebc10-b24d-47b3-acef-7c02805faee3) +![gpt-po](https://github.com/user-attachments/assets/872a01d5-e036-4678-bb68-92d79ace21e2) ## API Key Configuration diff --git a/python_gpt_po/po_translator.py b/python_gpt_po/po_translator.py index 4b89286..853753e 100644 --- a/python_gpt_po/po_translator.py +++ b/python_gpt_po/po_translator.py @@ -93,9 +93,9 @@ def __init__(self, client, model, bulk_mode=False, fuzzy=False, folder_language= class TranslationService: """ Class to encapsulate translation functionalities. """ - def __init__(self, config): + def __init__(self, config, batch_size=40): self.config = config - self.batch_size = 40 # Adjust this value based on your needs and API limits + self.batch_size = batch_size # Use the bulk size provided by the user self.total_batches = 0 self.po_file_handler = POFileHandler() @@ -466,7 +466,7 @@ def main(): config = TranslationConfig(client, args.model, args.bulk, args.fuzzy, args.folder_language) # Initialize the translation service with the configuration object - translation_service = TranslationService(config) + translation_service = TranslationService(config, args.bulksize) # Validate the OpenAI connection if not translation_service.validate_openai_connection():