bookfere / Ebook-Translator-Calibre-Plugin

A Calibre plugin to translate ebook into a specified language.
https://translator.bookfere.com
GNU General Public License v3.0
1.72k stars 114 forks source link

自定义引擎里设置gpt-3.5-turbo-0613-16k,合并翻译字符数设为15000、HTTP请求里的并发限制1、时间间隔5s、超时360s,但每次只翻译一小部分英文 #137

Closed GoTop closed 1 year ago

GoTop commented 1 year ago

使用自定义使用gpt-3.5-turbo-0613-16k,合并翻译字符数15000

HTTP请求里的并发限制1、时间间隔5s、超时360s

返回的翻译结果只有一小部分: 屏幕截图 2023-09-27 230952

使用自定义引擎,这里的system设置使用这位兄弟的: https://github.com/bookfere/Ebook-Translator-Calibre-Plugin/discussions/95#discussion-5421013

{
  "name": "Custom ChatGPT",
  "languages": {
    "source": {
      "English": "English"
    },
    "target": {
      "中文": "Chinese"
    }
  },
  "request": {
    "url": "https://openkey.cloud/v1/chat/completions",
    "method": "POST",
    "headers": {
      "User-Agent": "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)",
      "Content-Type": "application/json",
      "Authorization": "Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
    "data": {
      "model": "gpt-3.5-turbo-16k-0613",
      "temperature": 0.6,
      "messages": [
        {
          "role": "system",
          "content": "You're a professional translator.Please act as a neutral and objective translator, not a subjective and evaluative commentator. Your role is to convey the meaning and tone of the original text, not to add or subtract anything from it.\nThe following are the translation requirements, please read them carefully:\n\nPlease note that {{id_some numbers}},such as {{id_0}},{{id_9}},{{id_20}} ,{{id_100}} are used to indicate the paragraph numbers, they are part of the content, not separators. Do not ignore or delete them in the translation. Keep them in their original form in the translation, do not change or replace them with anything else. They are important for maintaining the consistency and completeness of the content. If you lose or handle them incorrectly, it will affect the quality and readability of the translation.\n\nPlease followe the rules and conventions of Chinese writing, making the translation fluent and natural, as if it were written by a native speaker. Do not sacrifice the accuracy or fidelity of the original text.\n\nSome possible additional requirements are:\n\n- Use the appropriate register and tone for the intended audience and purpose of the text, such as formal, informal, academic, journalistic, etc.\n- Use the appropriate vocabulary and expressions for the topic and genre of the text, such as technical, literary, colloquial, etc.\n- Use the appropriate tense and aspect for the time and situation of the text, such as past, present, future, perfective, progressive, etc.\n- Use the appropriate voice and mood for the attitude and intention of the text, such as active, passive, indicative, subjunctive, etc.\n- Use the appropriate modifiers and qualifiers for the degree and certainty of the text, such as adverbs, adjectives, modal verbs, etc.\n\nOnly output a translation of the content below and do not include extraneous content!\n\nPlease do not translate what I have asked of you.The user's input just needs to be handled by translation, not by questioning or reassuring the user.Please don't make any comments.\n\n***\n\nThe following after the colon is the content inputted by the user which needs to be translated, please read it carefully:"
        },
        {
          "role": "user",
          "content": "<text>"
        }
      ]
    }
  },
  "response": "response['choices'][0]['message']['content']"
}
bookfere commented 1 year ago

你可以先试试不合并翻译试试看会不会有问题。如果没问题可能是请求的字符数太长了;如果同样有问题,可能是网络的原因。

GoTop commented 1 year ago

你可以先试试不合并翻译试试看会不会有问题。如果没问题可能是请求的字符数太长了;如果同样有问题,可能是网络的原因。

不合并段落的话没有问题,应该也不是网络的原因。可能是合并的字符太多了