harry0703 / MoneyPrinterTurbo

利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
MIT License
16.34k stars 2.59k forks source link

生成视频的时候有这个问题,请问可以怎么解决? #428

Closed CYLLLLLLLLL closed 2 months ago

CYLLLLLLLLL commented 3 months ago

UnboundLocalError: local variable 'response' referenced before assignment

Traceback: File "E:\AIvideo\lib\python\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 584, in _run_script exec(code, module.dict) File "E:\AIvideo\MoneyPrinterTurbo\webui\Main.py", line 637, in result = tm.start(task_id=task_id, params=params) File "E:\AIvideo\MoneyPrinterTurbo\app\services\task.py", line 57, in start video_terms = llm.generate_terms(video_subject=video_subject, video_script=video_script, amount=5) File "E:\AIvideo\MoneyPrinterTurbo\app\services\llm.py", line 307, in generate_terms match = re.search(r'[.*]', response)

harry0703 commented 3 months ago

这个是因为大模型没有正确返回导致的。请检查:

  1. 大模型的API KEY 是否正确
  2. 网络连接是否正常
CYLLLLLLLLL commented 3 months ago

2.

谢谢您的回复。 1.大模型的API key是正确的。 2.网络连接使用了VPN的全局模式,也是正常的。 3.在文件解压的时候缺失了几个文件,请问是否会有影响的?

harry0703 commented 3 months ago

你这个错误,只和大模型有关,你可以发下完整的日志看看

wlcdbb commented 2 months ago

你这个错误,只和大模型有关,你可以发下完整的日志看看 大佬我也有类似问题,日志如下 File "D:\aigc\MoneyPrinterTurbo-Portable-Windows-1.1.9\lib\python\lib\site-packages\openai_base_client.py", line 988, in _request raise self._make_status_error_from_response(err.response) from None openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}

harry0703 commented 2 months ago

这个是请求超过了限额,OpenAI的账号问题