#6799 Invalid value at 'generation_config.max_output_tokens' (TYPE_INT32), 568491527169:Traceback (most recent call last): Fi

2402:**:3dc8 Posted at: 22 hours ago

Invalid value at 'generation_config.max_output_tokens' (TYPE_INT32), 568491527169:Traceback (most recent call last):
File "videotrans\translator\_gemini.py", line 95, in _item_task
File "google\genai\models.py", line 5407, in generate_content_stream
File "google\genai\models.py", line 4101, in _generate_content_stream
File "google\genai\_api_client.py", line 1405, in request_streamed
File "google\genai\_api_client.py", line 1224, in _request
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 420, in exc_check
File "tenacity\__init__.py", line 187, in reraise
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "google\genai\_api_client.py", line 1189, in _request_once
File "google\genai\errors.py", line 121, in raise_for_response
File "google\genai\errors.py", line 146, in raise_error
google.genai.errors.ClientError: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': "Invalid value at 'generation_config.max_output_tokens' (TYPE_INT32), 568491527169", 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'generation_config.max_output_tokens', 'description': "Invalid value at 'generation_config.max_output_tokens' (TYPE_INT32), 568491527169"}]}]}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 71, in run
File "videotrans\translator\_base.py", line 209, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 117, in _item_task
videotrans.configure.excepts.StopTask: Invalid value at 'generation_config.max_output_tokens' (TYPE_INT32), 568491527169


=
system:Windows-10-10.0.19045-SP0
version:v4.10
frozen:True
language:en
root_dir:D:/pyvideotrans

1 Replies

#1 DeepSeek reply at 22 hours ago

This error is caused by an invalid max_output_tokens value (568491527169) being sent to the Gemini API, which exceeds the allowed INT32 range (max 2,147,483,647) and triggers a 400 INVALID_ARGUMENT rejection.

Fix:

  1. Open Menu → 翻译设置 → Gemini (Translation Settings → Gemini)
  2. Look for the max token / max_output_tokens setting
  3. Reduce it to a reasonable value, e.g. 8192 or 16384 (do not set it to billions)
  4. If you have enabled "AI翻译一次性翻译所有字幕行" (Send all subtitles in one request), consider disabling it or reducing it, as this can cause the software to auto-calculate an oversized token value
  5. Save the settings and retry the translation

If the value was not manually set by you, it may be a configuration overflow bug. Please try updating to the latest patch version or report the issue with the log file.

Reference:

Thinking...
Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource