Open lucyknada opened 6 months ago
uncomment concurrency_limit and upgrade gradio and it should work just fine.
however im running into NameError: name 'PaddleOCR' is not defined, while made sure to install paddleocr as documented:
python3 -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
Hi, it is optional to install PaddleOCR
for better OCR experience, but it is not a necessary option.
If you want to install it, I guess you need to first installed PaddlePaddle and then install PaddleOCR. It is not so easy to install in some cases (at least for me). Of course, you can also choose another ocr detector for replacement with simple modification in the code.
There's quite a few gradio issues:
- function_markdown is undefined
- unexpected keyword concurrency_limit
- recursive json encoder
First two were "fixed" by just commenting them out, however the third issue prevent gradio working at all as it immediately crashes the instance with that error.
/xxx//minigemini/serve/gradio_web_server.py:351: UserWarning: `layout` parameter is deprecated, and it has no effect chatbot = gr.Chatbot( Traceback (most recent call last): File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/xxx/minigemini/serve/gradio_web_server.py", line 472, in <module> demo = build_demo(args.embed, concurrency_count=args.concurrency_count) File "/xxx/minigemini/serve/gradio_web_server.py", line 371, in build_demo gr.Markdown(function_markdown)
/xxx//minigemini/serve/gradio_web_server.py:351: UserWarning: `layout` parameter is deprecated, and it has no effect chatbot = gr.Chatbot( Traceback (most recent call last): File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/xxx//minigemini/serve/gradio_web_server.py", line 472, in <module> demo = build_demo(args.embed, concurrency_count=args.concurrency_count) File "/xxx//minigemini/serve/gradio_web_server.py", line 394, in build_demo regenerate_btn.click( TypeError: EventListenerMethod.__call__() got an unexpected keyword argument 'concurrency_limit'
File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 331, in jsonable_encoder return jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 331, in jsonable_encoder return jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 318, in jsonable_encoder if isinstance(obj, classes_tuple): File "/usr/lib64/python3.10/abc.py", line 119, in __instancecheck__ return _abc_instancecheck(cls, instance) RecursionError: maximum recursion depth exceeded in comparison
I can be able to run by modify the gradio version and apply the latest one (4.24.0), which now the web server is running normally and the upload file component look the same as the repo demo. I think this maybe the solution for the third issue and you can try.
There's quite a few gradio issues:
- function_markdown is undefined
- unexpected keyword concurrency_limit
- recursive json encoder
First two were "fixed" by just commenting them out, however the third issue prevent gradio working at all as it immediately crashes the instance with that error.
/xxx//minigemini/serve/gradio_web_server.py:351: UserWarning: `layout` parameter is deprecated, and it has no effect chatbot = gr.Chatbot( Traceback (most recent call last): File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/xxx/minigemini/serve/gradio_web_server.py", line 472, in <module> demo = build_demo(args.embed, concurrency_count=args.concurrency_count) File "/xxx/minigemini/serve/gradio_web_server.py", line 371, in build_demo gr.Markdown(function_markdown)
/xxx//minigemini/serve/gradio_web_server.py:351: UserWarning: `layout` parameter is deprecated, and it has no effect chatbot = gr.Chatbot( Traceback (most recent call last): File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/xxx//minigemini/serve/gradio_web_server.py", line 472, in <module> demo = build_demo(args.embed, concurrency_count=args.concurrency_count) File "/xxx//minigemini/serve/gradio_web_server.py", line 394, in build_demo regenerate_btn.click( TypeError: EventListenerMethod.__call__() got an unexpected keyword argument 'concurrency_limit'
File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 331, in jsonable_encoder return jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 331, in jsonable_encoder return jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 287, in jsonable_encoder encoded_value = jsonable_encoder( File "/xxx//venv/lib64/python3.10/site-packages/fastapi/encoders.py", line 318, in jsonable_encoder if isinstance(obj, classes_tuple): File "/usr/lib64/python3.10/abc.py", line 119, in __instancecheck__ return _abc_instancecheck(cls, instance) RecursionError: maximum recursion depth exceeded in comparison
I can be able to run by modify the gradio version and apply the latest one (4.24.0), which now the web server is running normally and the upload file component look the same as the repo demo. I think this maybe the solution for the third issue and you can try.
This solution does not work for me...
@gw00259532 Please share the problem you are encoutering, I can have a look and help 👍
@gw00259532 Please share the problem you are encoutering, I can have a look and help 👍
Hi, thanks for your help~ I encountered the same problem as described by @lucyknada. The gradio==4.24.0 was installed but the "function_markdown is undefined" error was still exist
Here are logs @WhiteWolf21
2024-04-18 10:51:37 | INFO | gradio_web_server | args: Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=16, model_list_mode='reload', share=False, moderate=False, embed=False)
2024-04-18 10:51:37 | INFO | gradio_web_server | Models: []
2024-04-18 10:51:37 | INFO | gradio_web_server | Namespace(host='0.0.0.0', port=None, controller_url='http://localhost:10000', concurrency_count=16, model_list_mode='reload', share=False, moderate=False, embed=False)
2024-04-18 10:51:37 | ERROR | stderr | /mnt/ws-data/data/project/MiniGemini/minigemini/serve/gradio_web_server.py:351: UserWarning: `layout` parameter is deprecated, and it has no effect
2024-04-18 10:51:37 | ERROR | stderr | chatbot = gr.Chatbot(
2024-04-18 10:51:37 | ERROR | stderr | Traceback (most recent call last):
2024-04-18 10:51:37 | ERROR | stderr | File "/home/yenianjin/anaconda3/envs/Alpaca/lib/python3.10/runpy.py", line 196, in _run_module_as_main
2024-04-18 10:51:37 | ERROR | stderr | return _run_code(code, main_globals, None,
2024-04-18 10:51:37 | ERROR | stderr | File "/home/yenianjin/anaconda3/envs/Alpaca/lib/python3.10/runpy.py", line 86, in _run_code
2024-04-18 10:51:37 | ERROR | stderr | exec(code, run_globals)
2024-04-18 10:51:37 | ERROR | stderr | File "/mnt/ws-data/data/project/MiniGemini/minigemini/serve/gradio_web_server.py", line 472, in <module>
2024-04-18 10:51:37 | ERROR | stderr | demo = build_demo(args.embed, concurrency_count=args.concurrency_count)
2024-04-18 10:51:37 | ERROR | stderr | File "/mnt/ws-data/data/project/MiniGemini/minigemini/serve/gradio_web_server.py", line 371, in build_demo
2024-04-18 10:51:37 | ERROR | stderr | gr.Markdown(function_markdown)
2024-04-18 10:51:37 | ERROR | stderr | NameError: name 'function_markdown' is not defined
@gw00259532 please uncomment like in the image:
@gw00259532 please uncomment like in the image:
I comment the lines gr.Markdown(function_markdown)
and concurrency_limit=concurrency_count
can fix the first two problems. Thanks a lot!
There's quite a few gradio issues:
First two were "fixed" by just commenting them out, however the third issue prevent gradio working at all as it immediately crashes the instance with that error.