Cerlancism / chatgpt-subtitle-translator

Efficient translation tool based on ChatGPT API
https://cerlancism.github.io/chatgpt-subtitle-translator/
MIT License
199 stars 16 forks source link

`Cooldown`时间过长 #29

Closed BrettDean closed 4 months ago

BrettDean commented 4 months ago

cli运行的,网页我跑不起来,,用项目中的示例网页的话,也不行,因为我api的机子在国内,没有ssl image 国外鸡调用国内API速度又不行,,


这是cli运行情况:

# root @ mx in /home/chatgpt-subtitle-translator on git:main x [16:06:43] 
$ cli/translator.mjs --no-use-moderator -i 1.srt --stream --to zh-cn --no-prefix-number --model glm-4       
[CLI] Assume SRT file 1.srt
(node:1560338) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[Translator] System Instruction: Translate to zh-cn
[Translator] Lines count mismatch 100 98
[Translator] batch [
  'Hey!',
  'What is all of this?!',
  "Hey, what's this?",
  'Hmm?',
  'Ukkomon!',
  '<i>The massive object,</i>',
  '<i>which has</i> \\N <i>been identified as a Digi-Egg,</i>',
  '<i>an object of Digimon origin,</i> \\N <i>even now continues to hover</i>',
  '<i>above Tokyo Tower, where it</i> \\N <i>first appeared a week ago.</i>',
  "<i>The message that it's apparently</i> \\N <i>broadcasting has been seen</i>",
  '<i>by countless numbers</i> \\N <i>of people all around the world,</i>',
  '<i>but so far, no one is completely</i> \\N <i>certain of just what it means,</i>',
  '<i>as the government</i> \\N <i>remains on heightened alert...</i>',
  "Oh, look! It's Tai!",
  "A whole week's passed,",
  "and that \\N thing's still floating up there.",
  "It's been really \\N overwhelming for Izzy.",
  'He keeps getting called \\N into all these interviews',
  'and brainstorming sessions.',
  'I can never get \\N a hold of him anymore.',
  'I saw him on \\N another television show',
  'just before this one.',
  "Well, he is the world's \\N foremost expert on Digimon.",
  'Judging by the look of things,',
  'I doubt heeven has time \\N to sleep.',
  '-Yeah, right. \\N Also!',
  'When I tried calling Tai \\N ge got all upset with me',
  "and told me that he's way \\N too busy for small talk.",
  "What? That's not like \\N him.",
  "I don't know. \\N Humans are always changing.",
  "-That's what I always say. \\N -What do we think?",
  'Any theories as to why \\N that Digi-Egg appeared?',
  "If Izzy hasn't been \\N able to figure it out,",
  "then I doubt we'll be able to.",
  "You know what'll happen?",
  "The longer it's up there, \\N the less attention it'll get.",
  'People will just get used to it.',
  'After all...',
  'Forget about that.',
  "It's time for a bowl \\N of tasty goodness.",
  'Satisfaction guaranteed.',
  'Let the eating begin.',
  'Hmm!',
  'It smells yummy!',
  "Looks delicious, doesn't it, \\N Ken?",
  'You did a surprisingly good job.',
  "It seems like you've \\N really upped your game.",
  "-What's that mean? \\N <i>-Breaking news...</i>",
  "<i>A man has been spotted climbing</i> \\N <i>up Tokyo Tower's antenna.</i>",
  'How dangerous.',
  "He has no wings. \\N If he falls, he's done for.",
  '-Is this some kind of stunt? \\N -You know what they say.',
  'Turn up the heat \\N and watch the weirdos come out.',
  'Wait. They say that?',
  "You only think it's hot \\N because you're making ramen.",
  "Nothing's better \\N than a hot kitchen.",
  "Hey, wait a sec. \\N Look what's in his hand.",
  'A Digivice?',
  'Then that means...',
  "That guy's a DigiDestined?",
  'Why would you show up \\N again now?',
  'After everything, why now?',
  "You're a...Digimon?",
  'Huh?',
  'Whoa.',
  'That was close.',
  '-Are you all right? \\N -Were you hurt when you fell?',
  "You didn't get scraped up, \\N did you?",
  'If it hurts anywhere, \\N just tell us.',
  "Yeah. Don't be a hero.",
  "I think it's best you go \\N to the hospital.",
  "Well, that's a lot of Digimon \\N and their partners.",
  'Hey, just a tip.',
  'When someone saves your life,',
  'usually the first \\N thing you do is say thanks.',
  "I don't recall asking anyone \\N to do anything.",
  "That's really \\N how you're gonna play it?",
  'You know, we sacrifice perfectly \\N good ramen to rescue you.',
  "If that's how you're gonna be, \\N you can pay for it.",
  '- Just give it a rest, Davis. \\N - Sorry, Yolei!',
  'So, what were you doing \\N up there?',
  'Do you have some connection \\N to that Digi-Egg?',
  'It has nothing \\N to do with any of you.',
  "Well, that's not really true, \\N though.",
  "You're a DigiDestined too, \\N aren't you?",
  "Destined. \\N That's one way of putting it.",
  "That's a Digivice in your hand. \\N So where's your Digimon?",
  "I don't have a Digimon. Okay?",
  'Huh? But then...',
  'If you must know,',
  "I don't have a Digimon.",
  "I don't, because I killed \\N the Digimon who was my partner.",
  'Hey, listen, just who are you?',
  'Who am I?',
  'I guess I was the first.',
  'The first person to form \\N a partnership with the Digimon.',
  'Huh? Seriously? Is that true?',
  "You're the first DigiDestined?",
  'So long.',
  'Thanks for saving me.'
]
[Translator] transformed [
  '嘿!',
  '这都是些什么?!',
  '喂,这是什么?',
  '嗯?',
  '乌克蒙!',
  '<i>这个巨大的物体,</i>',
  '<i>已经被确认为一个数码蛋,</i>',
  '<i>一个来自数码宝贝的物体,</i> \\N <i>即使现在仍然在东京塔上空盘旋,</i>',
  '<i>它在一周前首次出现在那里。</i>',
  '<i>它显然发出的信息已经被</i> \\N <i>全世界无数的人看到,</i>',
  '<i>但到目前为止,没有人完全</i> \\N <i>确定它的确切含义,</i>',
  '<i>政府仍然保持高度警惕...</i>',
  '哦,看!是泰!',
  '已经过去一整周了,',
  '那\\n东西还浮在那里。',
  '这对伊兹来说真的很\\n令人不知所措。',
  '他不断被叫去\\n参加各种访谈',
  '和头脑风暴会议。',
  '我再也无法\\n联系上他了。',
  '我在\\n这个节目之前的一个电视节目上见过他。',
  '嗯,毕竟他是世界上\\n最顶尖的数码宝贝专家。',
  '从情况看,',
  '我怀疑他\\n甚至没有时间睡觉。',
  '-是吗?\\n还有!',
  '我试着给泰打电话\\n他对我很生气',
  '说他现在太\\n忙了,没空闲聊。',
  '什么?这不像\\n他。',
  '我不知道。\\n人类总是在变化。',
  '-我一直这么说。\\n-你怎么看?',
  '对于那个数码蛋的出现\\n有什么理论吗?',
  '如果伊兹\\n都没能弄清楚,',
  '那么我怀疑我们也没办法。',
  '你知道会发生什么吗?',
  '它在上面待得越久,\\n得到的关注就越少。',
  '人们只会逐渐习惯。',
  '毕竟...',
  '别管那个了。',
  '是时候来一碗\\n美味的东西了。',
  '满意度保证。',
  '开始吃吧。',
  '嗯!',
  '真香!',
  '看起来很美味,不是吗,\\n肯?',
  '你做得出人意料地好。',
  '看来你的\\n厨艺真的提高了。',
  '-那是什么意思?\\n<i>-突发新闻...</i>',
  '<i>有人看到一名男子</i> \\N <i>正在攀爬东京塔的天线。</i>',
  '多危险啊。',
  '他没有翅膀。\\n如果他掉下来,就完了。',
  '-这是个特技吗?\\n-你知道人们怎么说。',
  '加热\\n看看怪人会出来。',
  '等等。他们这么说?',
  '你之所以觉得热\\n是因为你在做拉面。',
  '没有什么比\\n热厨房更好了。',
  '嘿,等一下。\\n看看他手里拿的是什么。',
  '数码器?',
  '那么这意味着...',
  '那个家伙是个数码选定者?',
  '你现在为什么\\n又出现了?',
  '在经历了一切之后,为什么是现在?',
  '你是个...数码宝贝?',
  '哈?',
  '哇。',
  '好险。',
  '-你没事吧?\\n-你摔下来受伤了吗?',
  '你没擦伤\\n哪里吧?',
  '如果哪里疼,\\n就告诉我们。',
  '是的,别逞英雄。',
  '我觉得你最好\\n去医院。',
  '嗯,那是很多数码宝贝\\n和他们的伙伴。',
  '嘿,给你个建议。',
  '当有人救了你的命,',
  '通常你首先\\n会说谢谢。',
  '我不记得要求任何人\\n做任何事情。',
  '这就是你\\n打算玩的方式?',
  '你知道,我们牺牲了完美的\\n拉面来救你。',
  '如果你打算这样,\\n你可以付钱。',
  '-别说了,戴维斯。\\n-对不起,约莱!',
  '那么,你刚才在\\n上面干什么?',
  '你和那个数码蛋\\n有什么联系吗?',
  '这和你们\\n任何人都没有关系。',
  '嗯,但这不是\\n真的。',
  '你也是个\\n数码选定者,不是吗?',
  '注定。\\n这是一种说法。',
  '你手里拿着的是数码器。\\n那么你的数码宝贝呢?',
  '我没有数码宝贝。好吧?',
  '哈?但是...',
  '如果你一定要知道,',
  '我没有数码宝贝。',
  '我没有,因为我杀死了\\n与我搭档的数码宝贝。',
  '听着,你到底是谁?',
  '我是谁?',
  '我想我是第一个。',
  '第一个与数码宝贝\\n形成伙伴关系的人。',
  '哈?真的吗?这是真的?',
  '你是第一个数码选定者?',
  '那么久。',
  '谢谢你救了我。'
]
[Translator] BatchSize decrease 100 -> 10 SizeThreshold 10
[Translator] Cost computation not supported yet for glm-4
[Cooldown] ChatGPTAPI 21715 ms
1 "Hey!" -> "嘿!"
2 "What is all of this?!" -> "这都是些什么?!"
3 "Hey, what's this?" -> "喂,这是什么?"
4 "Hmm?" -> "嗯?"
5 "Ukkomon!" -> "乌克蒙!"
6 "<i>The massive object,</i>" -> "<i>这个巨大的物体,</i>"
7 "<i>which has</i>
<i>been identified as a Digi-Egg,</i>" -> "<i>已经被确认为一个数码蛋,</i>"
8 "<i>an object of Digimon origin,</i>
<i>even now continues to hover</i>" -> "<i>一个来自数码宝贝的物体,</i> \N <i>即便现在仍然在</i>"
9 "<i>above Tokyo Tower, where it</i>
<i>first appeared a week ago.</i>" -> "<i>东京塔上空盘旋,</i> \N <i>它在一周前首次出现在那里。</i>"
10 "<i>The message that it's apparently</i>
<i>broadcasting has been seen</i>" -> "<i>它显然播报的信息已经</i> \N <i>被观测到</i>"
[Translator] Cost computation not supported yet for glm-4
[Cooldown] ChatGPTAPI 55215 ms
[Translator] Lines count mismatch 10 11
[Translator] batch [
  '<i>by countless numbers</i> \\N <i>of people all around the world,</i>',
  '<i>but so far, no one is completely</i> \\N <i>certain of just what it means,</i>',
  '<i>as the government</i> \\N <i>remains on heightened alert...</i>',
  "Oh, look! It's Tai!",
  "A whole week's passed,",
  "and that \\N thing's still floating up there.",
  "It's been really \\N overwhelming for Izzy.",
  'He keeps getting called \\N into all these interviews',
  'and brainstorming sessions.',
  'I can never get \\N a hold of him anymore.'
]
[Translator] transformed [
  '<i>被全球无数的人</i> \\N <i>观测到,</i>',
  '<i>但到目前为止,没有人能完全</i> \\N <i>确定它究竟意味着什么,</i>',
  '<i>因为政府</i> \\N <i>仍然保持高度警惕...</i>',
  '哦,看!是泰!',
  '已经过去整整一周了,',
  '那玩意儿还飘在那里。',
  '这对伊兹来说真是',
  '压力很大。',
  '他不断被叫去',
  '参加各种采访和头脑风暴会议。',
  '我现在再也联系不上他了。'
]
[Translator] Single line mode
[Cooldown] ChatGPTAPI 54640 ms
11 "<i>by countless numbers</i>
<i>of people all around the world,</i>" -> "<i>被全球无数的人</i> \N <i>观测到了。</i>"
[Cooldown] ChatGPTAPI 58357 ms
12 "<i>but so far, no one is completely</i>
<i>certain of just what it means,</i>" -> "<i>但到目前为止,没有人完全</i> \N <i>确定它究竟意味着什么。</i>"
[Cooldown] ChatGPTAPI 58357 ms
13 "<i>as the government</i>
<i>remains on heightened alert...</i>" -> "<i>由于政府</i> \N <i>仍保持高度警惕……</i>"
[Cooldown] ChatGPTAPI 58162 ms
14 "Oh, look! It's Tai!" -> "哦,看!是泰!Tai!"
[Cooldown] ChatGPTAPI 58775 ms

可能是一直没对上,最后变成Single line mode

[Cooldown] ChatGPTAPI 58775 ms 每条要等一分钟属实比较长,希望能短一点,

另外大佬方便打包一个docker镜像吗

Cerlancism commented 4 months ago

你的端口有 RPM 限制吗? 减少 [Cooldown] 可先在 .envRPM 调高

OPENAI_API_RPM=500
BrettDean commented 4 months ago

你的端口有 RPM 限制吗? 减少 [Cooldown] 可先在 .envRPM 调高

OPENAI_API_RPM=500

牛逼!解决了 我这里限制并发是5,设置了OPENAI_API_RPM=300以后,解决了! 感谢大佬,项目牛逼