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

3 gradio issues #13

Open
lucyknada opened this issue Mar 29, 2024 · 9 comments
Open

3 gradio issues #13

lucyknada opened this issue Mar 29, 2024 · 9 comments

Comments

@lucyknada
Copy link

There's quite a few gradio issues:

  1. function_markdown is undefined
  2. unexpected keyword concurrency_limit
  3. 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
@lightingvector
Copy link
Contributor

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

@yanwei-li
Copy link
Member

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.

@WhiteWolf21
Copy link

WhiteWolf21 commented Apr 2, 2024

There's quite a few gradio issues:

  1. function_markdown is undefined
  2. unexpected keyword concurrency_limit
  3. 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.

image

@gw00259532
Copy link

There's quite a few gradio issues:

  1. function_markdown is undefined
  2. unexpected keyword concurrency_limit
  3. 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.

image

This solution does not work for me...

@WhiteWolf21
Copy link

@gw00259532 Please share the problem you are encoutering, I can have a look and help 👍

@gw00259532
Copy link

@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

@gw00259532
Copy link

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

@WhiteWolf21
Copy link

@gw00259532 please uncomment like in the image:
image

@gw00259532
Copy link

@gw00259532 please uncomment like in the image: image

I comment the lines gr.Markdown(function_markdown) and concurrency_limit=concurrency_count can fix the first two problems. Thanks a lot!

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

5 participants