jianchang512 / pyvideotrans

Translate the video from one language to another and add dubbing. 将视频从一种语言翻译为另一种语言,并支持api调用
https://pyvideotrans.com
GNU General Public License v3.0
10.04k stars 1.1k forks source link

azureGPT error #503

Closed johnfelipe closed 1 week ago

johnfelipe commented 1 month ago
2024-08-12 11:44:16,862 - VideoTrans - INFO - Wait to modify original language subtitles / continue
2024-08-12 11:44:16,863 - VideoTrans - INFO - 14 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:17,870 - VideoTrans - INFO - 13 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:18,879 - VideoTrans - INFO - 12 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:19,891 - VideoTrans - INFO - 11 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:20,896 - VideoTrans - INFO - 10 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:21,909 - VideoTrans - INFO - 9 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:22,913 - VideoTrans - INFO - 8 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:23,929 - VideoTrans - INFO - 7 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:24,934 - VideoTrans - INFO - 6 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:25,943 - VideoTrans - INFO - 5 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:26,952 - VideoTrans - INFO - 4 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:27,962 - VideoTrans - INFO - 3 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:28,966 - VideoTrans - INFO - 2 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:29,971 - VideoTrans - INFO - 1 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:30,979 - VideoTrans - INFO - 0 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 11:44:31,989 - VideoTrans - INFO - translate_start
2024-08-12 11:44:34,003 - VideoTrans - INFO - Start translating
2024-08-12 11:44:34,594 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 11:44:43,403 - VideoTrans - ERROR - [AzureGPT]请求失败:Connection error.
2024-08-12 11:44:43,404 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 11:44:43,404 - VideoTrans - INFO - 1 retries after error
2024-08-12 11:44:53,475 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 11:45:02,371 - VideoTrans - ERROR - [AzureGPT]请求失败:Connection error.
2024-08-12 11:45:02,371 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 11:45:02,371 - VideoTrans - INFO - 2 retries after error
2024-08-12 11:45:12,436 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 11:45:20,892 - VideoTrans - ERROR - [AzureGPT]请求失败:Connection error.
2024-08-12 11:45:20,893 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 11:45:20,893 - VideoTrans - ERROR - [AzureGPT]翻译请求失败:err='3 retries after error persists :Connection error.'
2024-08-12 11:45:20,963 - VideoTrans - ERROR - AzureGPT:3 retries after error persists :Connection error.
Traceback (most recent call last):
  File "videotrans\task\step.py", line 165, in trans
  File "videotrans\translator\__init__.py", line 450, in run
  File "videotrans\translator\azure.py", line 187, in trans
Exception: AzureGPT:3 retries after error persists :Connection error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "videotrans\task\trans_create.py", line 348, in trans
  File "videotrans\task\step.py", line 173, in trans
Exception: AzureGPT:3 retries after error persists :Connection error.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "videotrans\task\job.py", line 47, in run
  File "videotrans\task\trans_create.py", line 352, in trans
Exception: AzureGPT:3 retries after error persists :Connection error.
2024-08-12 11:45:20,964 - VideoTrans - ERROR - Error in subtitle translation:AzureGPT:3 retries after error persists :Connection error.
jianchang512 commented 1 month ago

show info image

johnfelipe commented 1 month ago

SNAG-0580

i will test without proxy

johnfelipe commented 1 month ago

SNAG-0581

testing without proxy

johnfelipe commented 1 month ago

SNAG-0582

still with error:

Traceback (most recent call last):
  File "videotrans\task\job.py", line 47, in run
  File "videotrans\task\trans_create.py", line 352, in trans
Exception: Mircosoft:Failed to connect to Microsoft Translate, please change to another translation channel
2024-08-12 12:18:17,509 - VideoTrans - ERROR - Error in subtitle translation:Mircosoft:Failed to connect to Microsoft Translate, please change to another translation channel
2024-08-12 12:30:18,151 - VideoTrans - INFO - D:/Users/GAMEMAX/Downloads/Udemy_AWS_Bedrock_Workshop_Build_a_Gen_AI_Chatbot_Level_100/4. Workshop - Its time to create a Chatbot using AWS Bedrock/_video_out/2. Writing Chatbot backend Code - Part 1
2024-08-12 12:30:18,152 - VideoTrans - INFO - Hold on a monment
2024-08-12 12:30:18,230 - VideoTrans - INFO - 2. Writing Chatbot backend Code - Part 1.mp4
2024-08-12 12:30:18,230 - VideoTrans - INFO - Start processing
2024-08-12 12:30:18,231 - VideoTrans - INFO - no
2024-08-12 12:31:01,505 - VideoTrans - INFO - Start speech recognition
2024-08-12 12:31:02,019 - VideoTrans - INFO - Wait to modify original language subtitles / continue
2024-08-12 12:31:02,019 - VideoTrans - INFO - 14 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:03,022 - VideoTrans - INFO - 13 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:04,024 - VideoTrans - INFO - 12 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:05,037 - VideoTrans - INFO - 11 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:06,050 - VideoTrans - INFO - 10 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:07,051 - VideoTrans - INFO - 9 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:08,057 - VideoTrans - INFO - 8 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:09,063 - VideoTrans - INFO - 7 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:10,068 - VideoTrans - INFO - 6 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:11,072 - VideoTrans - INFO - 5 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:12,075 - VideoTrans - INFO - 4 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:13,078 - VideoTrans - INFO - 3 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:14,082 - VideoTrans - INFO - 2 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:15,087 - VideoTrans - INFO - 1 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:16,089 - VideoTrans - INFO - 0 Automatically translated in seconds, you can click Pause and edit subtitles so that the translation is more accurate
2024-08-12 12:31:17,093 - VideoTrans - INFO - translate_start
2024-08-12 12:31:19,095 - VideoTrans - INFO - Start translating
2024-08-12 12:31:19,572 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 12:31:20,322 - VideoTrans - ERROR - [AzureGPT]请求失败:Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
2024-08-12 12:31:20,322 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 12:31:20,322 - VideoTrans - INFO - 1 retries after error
2024-08-12 12:31:30,345 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 12:31:30,821 - VideoTrans - ERROR - [AzureGPT]请求失败:Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
2024-08-12 12:31:30,821 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 12:31:30,822 - VideoTrans - INFO - 2 retries after error
2024-08-12 12:31:40,843 - VideoTrans - INFO - 
[AzureGPT]请求数据:message=[{'role': 'system', 'content': 'You are a professional, helpful translation engine that translates only the content in <source> and returns only the translation results'}, {'role': 'user', 'content': '请将原文内容按字面意思翻译到Spanish language,然后只输出译文,不要添加任何说明或引导词。\n\n**格式要求:**\n- 按行翻译原文,并生成该行对应的译文,确保原文行和译文行中的每个单词相互对应。\n- 有几行原文,必须生成几行译文。\n\n**内容要求:**\n- 翻译必须精简短小,避免长句。\n- 如果原文无法翻译,请返回空行,不得添加“无意义语句或不可翻译”等任何提示语。\n- 只输出译文即可,禁止输出任何原文。\n\n**执行细节:**\n- 如果某行原文很短,在翻译后也仍然要保留该行,不得与上一行或下一行合并。\n- 原文换行处字符相对应的译文字符也必须换行。\n- 严格按照字面意思翻译,不要解释或回答原文内容。\n\n**最终目标:**\n- 提供格式与原文完全一致的高质量翻译结果。\n'}]
2024-08-12 12:31:41,499 - VideoTrans - ERROR - [AzureGPT]请求失败:Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
2024-08-12 12:31:41,499 - VideoTrans - ERROR - 翻译出错:暂停0s
2024-08-12 12:31:41,500 - VideoTrans - ERROR - [AzureGPT]翻译请求失败:err="3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}"
2024-08-12 12:31:41,546 - VideoTrans - ERROR - AzureGPT:3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
Traceback (most recent call last):
  File "videotrans\task\step.py", line 165, in trans
  File "videotrans\translator\__init__.py", line 450, in run
  File "videotrans\translator\azure.py", line 187, in trans
Exception: AzureGPT:3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "videotrans\task\trans_create.py", line 348, in trans
  File "videotrans\task\step.py", line 173, in trans
Exception: AzureGPT:3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "videotrans\task\job.py", line 47, in run
  File "videotrans\task\trans_create.py", line 352, in trans
Exception: AzureGPT:3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
2024-08-12 12:31:41,547 - VideoTrans - ERROR - Error in subtitle translation:AzureGPT:3 retries after error persists :Error code: 401 - {'error': {'code': '401', 'message': 'The ChatCompletions_Create Operation under Azure OpenAI API version 2024-02-01 is not supported with the current subscription key and pricing tier TextTranslator.S1.'}}
jianchang512 commented 1 month ago

update to https://github.com/jianchang512/pyvideotrans/releases/download/v2.26/win-PatchUpdate-2.29.7z

johnfelipe commented 1 month ago

solved

johnfelipe commented 1 month ago

v2.3

SNAG-0605

how solve this?

jianchang512 commented 1 month ago

Incorrect Pricing Tier: The TextTranslator.S1 pricing tier is specifically for the Text Translator service and does not include support for OpenAI's ChatCompletions API. To use OpenAI's Chat API, you need to ensure that you are subscribed to a pricing tier that includes access to the OpenAI services, such as Standard, Premium, or another appropriate tier depending on the Azure region and specific services.

update key

johnfelipe commented 1 month ago

SNAG-0002

is not listed in your app latest version of gpt4o in azure

johnfelipe commented 3 weeks ago

pls help me with this one, wich one need to select with my API?

SNAG-0064

is working normally in this app for translate with all kind of dev formats, i think with srt will be same...

jianchang512 commented 3 weeks ago

2024-06-01

This doesn't seem to be available, pyvideotrans supports Azure's openai, not just text or document translation

https://learn.microsoft.com/en-us/azure/ai-services/openai/