lm-sys / lm-sys/FastChat

Gradio 5 is out, and there are many improvements.

Open
#3,669 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.5k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

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:

```python
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

```python
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.
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with fastchat/serve/gradio_web_server.py, especially load_demo and load_demo_single, then reproduce the reported Gradio 5 logs. Review the Gradio 5 breaking changes affecting this server and verify that the web server works without the reported AttributeError and output-value warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.