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

Uncaught app exception(TypeError: 'NoneType' object is not iterable) #564

Open
1 task done
liuyanfeng-githug opened this issue Jan 7, 2025 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@liuyanfeng-githug
Copy link

是否已存在类似问题?

  • 我已搜索现有问题

当前行为

大佬我这前几天还能运行很好有数据正常输出今天就报错了。烦劳大佬帮看下啥情况

2025-01-07 18:34:36 | INFO | "./app/services/task.py:128": get_video_materials
preprocess local materials
2025-01-07 18:34:36.636 Uncaught app exception
Traceback (most recent call last):
File "/Users/anaconda3/envs/MoneyPrinterTurbo/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "/Users/anaconda3/envs/MoneyPrinterTurbo/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "/Users/moneyprinter/webui/Main.py", line 804, in
result = tm.start(task_id=task_id, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/task.py", line 283, in start
downloaded_videos = get_video_materials(
^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/task.py", line 129, in get_video_materials
materials = video.preprocess_video(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/video.py", line 334, in preprocess_video
for material in materials:
TypeError: 'NoneType' object is not iterable

预期行为

继续执行按照文案创建视频

重现步骤

输入标题千问自动创建文案报这个错。然后我不用千问生成文案直接粘贴文案也报这个错

堆栈追踪/日志

2025-01-07 18:34:36 | INFO | "./app/services/task.py:128": get_video_materials -

preprocess local materials

2025-01-07 18:34:36.636 Uncaught app exception
Traceback (most recent call last):
File "/Users/anaconda3/envs/MoneyPrinterTurbo/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "/Users/anaconda3/envs/MoneyPrinterTurbo/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.dict)
File "/Users/moneyprinter/webui/Main.py", line 804, in
result = tm.start(task_id=task_id, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/task.py", line 283, in start
downloaded_videos = get_video_materials(
^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/task.py", line 129, in get_video_materials
materials = video.preprocess_video(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/moneyprinter/app/services/video.py", line 334, in preprocess_video
for material in materials:
TypeError: 'NoneType' object is not iterable

Python 版本

3.11

操作系统

macOS

MoneyPrinterTurbo 版本

v1.2.1

其他信息

No response

@liuyanfeng-githug liuyanfeng-githug added the bug Something isn't working label Jan 7, 2025
@liuyanfeng-githug liuyanfeng-githug changed the title Uncaught app exception Uncaught app exception(TypeError: 'NoneType' object is not iterable) Jan 9, 2025
@LU-K-Brant
Copy link

这个报错估计是因为你选择本地文件导致 "video_materials"为null, 他main.py这部分代码逻辑导致的, 所以你要选择一个视频来源。 但我觉得我理想情况生成视频是不需要视频来源的,
if uploaded_files:
local_videos_dir = utils.storage_dir("local_videos", create=True)
for file in uploaded_files:
file_path = os.path.join(local_videos_dir, f"{file.file_id}_{file.name}")
with open(file_path, "wb") as f:
f.write(file.getbuffer())
m = MaterialInfo()
m.provider = "local"
m.url = file_path
if not params.video_materials:
params.video_materials = []
params.video_materials.append(m)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants