Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pescheck-bram committed Aug 21, 2024
1 parent c1d8783 commit 84a848a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions python_gpt_po/po_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 84a848a

Please sign in to comment.