Evil0ctal / Evil0ctal/Minecraft-Plugin-AI-Translater

求大佬解答 0.0

Open
#1 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
25
Forks
0
PR merge metrics
No merged PRs in 30d

Description

输入路径是文件夹,开始批量处理...
Input path is a directory, start batch processing...
当前正在处理文件:config.yml
Currently processing file: config.yml
文件内容长度98003超过最大长度1024,开始使用PKVPM算法拆分内容...
File content length 98003 exceeds the maximum length 1024, start splitting the content using PKVPM algorithm...
原始文件内容长度:98003
共拆分为38部分进行翻译
翻译第1部分...
Translating the 1 part...
第1部分翻译失败:Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk258***************************************38f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
如果再次失败,请检查文件内容。
The 1 part of the translation failed: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk258***************************************38f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
If it fails again, please check the file content.
Traceback (most recent call last):
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 274, in
main(_output_language=output_language,
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 236, in main
translated_count = process_directory(_input_path, _model, _output_language, _max_tokens, _output_path, log_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 218, in process_directory
process_file(file_path, _model, _output_language, _max_tokens, output_folder, log_path)
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 173, in process_file
translated_part = openai_interact(prompt=_prompt, part=part, model=_model, max_tokens=_max_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\Desktop\ChatGPT-Minecraft-Plugin-Translater-main\main.py", line 73, in openai_interact
response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\_utils\_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\resources\chat\completions.py", line 663, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\_base_client.py", line 1200, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\_base_client.py", line 889, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\11610\AppData\Local\Programs\Python\Python312\Lib\site-packages\openai\_base_client.py", line 980, in _request
raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-zk258***************************************38f6. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.