Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新版本容易出现报错 #281

Open
assassinliujie opened this issue Nov 24, 2024 · 3 comments
Open

新版本容易出现报错 #281

assassinliujie opened this issue Nov 24, 2024 · 3 comments

Comments

@assassinliujie
Copy link

Exception: Still failed after 3 attempts: JSON parsing still failed after 3 attempts: ❎ API response error: Missing required key: split Please check your network connection or API key or output/gpt_log/error.json to debug.
Traceback:
File "/root/anaconda3/envs/videoaaa/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "/root/anaconda3/envs/videoaaa/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
exec(code, module.dict)
File "/root/VideoLingo/st.py", line 123, in
main()
File "/root/VideoLingo/st.py", line 119, in main
text_processing_section()
File "/root/VideoLingo/st.py", line 33, in text_processing_section
process_text()
File "/root/VideoLingo/st.py", line 50, in process_text
step3_2_splitbymeaning.split_sentences_by_meaning()
File "/root/VideoLingo/core/step3_2_splitbymeaning.py", line 119, in split_sentences_by_meaning
sentences = parallel_split_sentences(sentences, max_length=load_key("max_split_length"), max_workers=load_key("max_workers"), nlp=nlp, retry_attempt=retry_attempt)
File "/root/VideoLingo/core/step3_2_splitbymeaning.py", line 101, in parallel_split_sentences
split_result = future.result()
File "/root/anaconda3/envs/videoaaa/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/root/anaconda3/envs/videoaaa/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/root/anaconda3/envs/videoaaa/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/root/VideoLingo/core/step3_2_splitbymeaning.py", line 60, in split_sentence
response_data = ask_gpt(split_prompt + ' ' * retry_attempt, response_json=True, valid_def=valid_split, log_title='sentence_splitbymeaning')
File "/root/VideoLingo/core/ask_gpt.py", line 103, in ask_gpt
raise Exception(f"Still failed after {max_retries} attempts: {e}")
多个视频出现这种情况,之前从来没有遇到过,是否是切分算法有调整。现在很难完整切完一个视频

@assassinliujie
Copy link
Author

用的claude-3-5-sonnet

@assassinliujie
Copy link
Author

nAI staff working on the browser[br]aren't the same ones who accidentally erased critical evidence"\n}\n\n\nThis split adheres to the Netflix subtitle standards by:\n1. Maintaining sentence meaning coherence\n2. Keeping both parts roughly equal in length (9 words and 10 words)\n3. Splitting at a natural point before the word \"aren't\"\n4. Ensuring each part is at least 3 words long\n5. Keeping each part under 20 words\n\nThe [br] tag is placed at the split position as requested.", "message": "json_repair parsing failed." }, { "model": "claude-3-5-sonnet-all", "prompt": "### Role\nYou are a professional Netflix subtitle splitter in en.\n\n### Task\nSplit the given subtitle text into 2 parts, each less than 20 words.\n\n### Instructions\n1. Maintain sentence meaning coherence according to Netflix subtitle standards\n2. Keep parts roughly equal in length (minimum 3 words each)\n3. Split at natural points like punctuation marks or conjunctions\n\n### Output Format in JSON\n{\n \"analysis\": \"Brief analysis of the text structure\",\n \"split\": \"Complete sentence with [br] tags at split positions\"\n}\n\n### Given Text\n<split_this_sentence>\nI can only hope the OpenAI staff working on the browser aren't the same ones who accidentally erased critical evidence\n</split_this_sentence>", "response": [ { "analysis": "The sentence is 19 words long, making it suitable for a single split. The natural break point is after 'browser', which creates two balanced parts.", "split": "I can only hope the OpenAI staff working on the browser[br]aren't the same ones who accidentally erased critical evidence" }, [ "br] tag is placed at the split position as requested." ] ], "message": "Missing required key: `split`" }, { "model": "claude-3-5-sonnet-all", "prompt": "### Role\nYou are a professional Netflix subtitle splitter in en.\n\n### Task\nSplit the given subtitle text into 2 parts, each less than 20 words.\n\n### Instructions\n1. Maintain sentence meaning coherence according to Netflix subtitle standards\n2. Keep parts roughly equal in length (minimum 3 words each)\n3. Split at natural points like punctuation marks or conjunctions\n\n### Output Format in JSON\n{\n \"analysis\": \"Brief analysis of the text structure\",\n \"split\": \"Complete sentence with [br] tags at split positions\"\n}\n\n### Given Text\n<split_this_sentence>\nI can only hope the OpenAI staff working on the browser aren't the same ones who accidentally erased critical evidence\n</split_this_sentence>", "response": "Here's the subtitle split for the given text, formatted as requested:\n\njson\n{\n "analysis": "The sentence is 19 words long, making it suitable for a single split. The natural break point is after 'browser', which creates two balanced parts.",\n "split": "I can only hope the OpenAI staff working on the browser[br]aren't the same ones who accidentally erased critical evidence"\n}\n```\n\nThis split adheres to the Netflix subtitle standards by:\n1. Maintaining sentence meaning coherence\n2. Keeping both parts roughly equal in length (9 words and 10 words)\n3. Splitting at a natural point before the word "aren't"\n4. Ensuring each part is at least 3 words long\n5. Keeping each part under 20 words\n\nThe [br] tag is placed at the split position as requested.",
"message": "json_repair parsing failed."
}

@Huanshere
Copy link
Owner

“Missing required key: split Please check your network connection or API key or output/gpt_log/error.json to debug.”

请问使用的什么来源的 claude 呢?看起来不是 claude 不够聪明,而是响应不稳定。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants