machinewrapped / gpt-subtrans

Open Source project using LLMs to translate SRT subtitles
Other
330 stars 40 forks source link

Python stderr: INFO: error_code=None error_message="Invalid value for 'content': expected a string, got null." error_param=messages.[4].content error_type=invalid_request_error message='OpenAI API error received' stream_error=False #43

Closed chen-rn closed 1 year ago

chen-rn commented 1 year ago

I've been getting this error for some reason, any ideas what it's caused by?

Python stderr: INFO: Translating 496 subtitles from original_captions/aTEv0-ZBbWk-ja_ja.srt
INFO: Translating 496 lines in 1 scenes

Python stderr: WARNING: Unable to match 30 lines with a source line

Python stderr: WARNING: Scene 1 batch 1 failed validation, requesting retranslation

Python stderr: INFO: error_code=None error_message="Invalid value for 'content': expected a string, got null." error_param=messages.[4].content error_type=invalid_request_error message='OpenAI API error received' stream_error=False

Python stderr: WARNING: Error translating batch: Invalid value for 'content': expected a string, got null.

here are the errors around it.

chen-rn commented 1 year ago

actually i think it's an issue in my code somewhere! i'm using a python process in node but it's not producing same result as just running the script

machinewrapped commented 1 year ago

Can't help you much there, but have you looked at @nekosaur 's Node port? https://github.com/nekosaur/gpt-subtrans-node

chen-rn commented 1 year ago

ohh i have not! But it looks promising, I'll give it a try later today!

chen-rn commented 1 year ago

It does work in my node env which is nice! and the code seems slightly simpler as well, not sure if it's missing any of the larger features. However, the main issue seems to be ensuring the number of ouput lines.

I don't want to use GPT4 since it costs so much, but it seems that 3.5 turbo frequently messes up the number of lines :(