FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

Gradio 5 is out, and there are many improvements.

Open surak opened this issue 10 months ago • 0 comments
trafficstars

Gradio 5 has come out. It has two things which are interesting:

  • It's much faster,
  • It has a resizable chatbot field.

However, a lot of things changed in it. And while gradio_web_server.py works just fine with it, it produces an inordinate amount of warnings and errors on the logs, due to some breaking changes.

For example:

2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/queueing.py", line 625, in process_events
2025-01-24 19:24:48 | ERROR | stderr |     response = await route_utils.call_process_api(
2025-01-24 19:24:48 | ERROR | stderr |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/route_utils.py", line 322, in call_process_api
2025-01-24 19:24:48 | ERROR | stderr |     output = await app.get_blocks().process_api(
2025-01-24 19:24:48 | ERROR | stderr |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/blocks.py", line 2042, in process_api
2025-01-24 19:24:48 | ERROR | stderr |     result = await self.call_function(
2025-01-24 19:24:48 | ERROR | stderr |              ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/blocks.py", line 1589, in call_function
2025-01-24 19:24:48 | ERROR | stderr |     prediction = await anyio.to_thread.run_sync(  # type: ignore
2025-01-24 19:24:48 | ERROR | stderr |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
2025-01-24 19:24:48 | ERROR | stderr |     return await get_async_backend().run_sync_in_worker_thread(
2025-01-24 19:24:48 | ERROR | stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
2025-01-24 19:24:48 | ERROR | stderr |     return await future
2025-01-24 19:24:48 | ERROR | stderr |            ^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 859, in run
2025-01-24 19:24:48 | ERROR | stderr |     result = context.run(func, *args)
2025-01-24 19:24:48 | ERROR | stderr |              ^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/utils.py", line 883, in wrapper
2025-01-24 19:24:48 | ERROR | stderr |     response = f(*args, **kwargs)
2025-01-24 19:24:48 | ERROR | stderr |                ^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/fastchat/serve/gradio_web_server.py", line 285, in load_demo
2025-01-24 19:24:48 | ERROR | stderr |     return load_demo_single(models, url_params)
2025-01-24 19:24:48 | ERROR | stderr |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr |   File "/Users/surak/Devel/FastChat/fastchat/serve/gradio_web_server.py", line 257, in load_demo_single
2025-01-24 19:24:48 | ERROR | stderr |     models = context.text_models
2025-01-24 19:24:48 | ERROR | stderr |              ^^^^^^^^^^^^^^^^^^^
2025-01-24 19:24:48 | ERROR | stderr | AttributeError: 'list' object has no attribute 'text_models'

And

2025-01-24 19:24:59 | ERROR | stderr | /Users/surak/Devel/FastChat/sc_venv_template/venv/lib/python3.11/site-packages/gradio/blocks.py:1775: UserWarning: A function (add_text) returned too many output values (needed: 8, returned: 9). Ignoring extra values.

surak avatar Jan 24 '25 18:01 surak