mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-22 15:14:54 +01:00
Fixing the path to the tranlsations.json
the translations.json is located inside the parent directory so this change will fix it.
This commit is contained in:
@@ -27,9 +27,19 @@ def default_max_tokens(model: str) -> int:
|
|||||||
return 1200 if model in GPT_3_MODELS else 2400
|
return 1200 if model in GPT_3_MODELS else 2400
|
||||||
|
|
||||||
|
|
||||||
with open('translations.json', 'r', encoding='utf-8') as f:
|
### this will reload the correct translations.json which is located inside the parent directory
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
parent_dir_path = os.path.join(os.path.dirname(__file__), os.pardir)
|
||||||
|
translations_file_path = os.path.join(parent_dir_path, 'translations.json')
|
||||||
|
|
||||||
|
with open(translations_file_path, 'r', encoding='utf-8') as f:
|
||||||
translations = json.load(f)
|
translations = json.load(f)
|
||||||
|
|
||||||
|
#with open('translations.json', 'r', encoding='utf-8') as f:
|
||||||
|
# translations = json.load(f)
|
||||||
|
|
||||||
|
|
||||||
def localized_text(key, bot_language):
|
def localized_text(key, bot_language):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user