gradio-app / gradio

Build and share delightful machine learning apps, all in Python. šŸŒŸ Star to support our work!
http://www.gradio.app
Apache License 2.0
33.72k stars 2.56k forks source link

Too many arguments provided for the endpoint - JavaScript-Warning in browser console #9895

Open machnicole opened 1 day ago

machnicole commented 1 day ago

Describe the bug

When launching a gradio application with gradio.Chatbot or gradio.ChatInterface, there is a JavaScript-Warning in the browser console every time a message is submitted:

Too many arguments provided for the endpoint.

You can also see these warnings in the chatbot-boxes in the official gradio documentation or in the gradio playground.

My analysis so far:

Apparently, endpoint_info is undefined here. Therefore, the length of parameters can never correspond with those parameters that one tries to send. I also don't really understand about which endpoints all of this is, after all. Also, I don't know what this "/info"-endpoint is that is referenced here. Regardless of the length of this parameter, the function in which it is located will always be terminated early, or the input data will be returned unchanged. However, the 'fix' that is now causing the warnings was likely introduced by this commit / #8820.

There are no practical problems due to this warning in our chat applications. However, we don't really want to deploy anything that causes warnings. Is there a way to prevent this warning?

Have you searched existing issues? šŸ”Ž

Reproduction

import random
import gradio as gr

def random_response(message, history):
    return random.choice(["Yes", "No"])

gr.ChatInterface(random_response, type="messages").launch()

Screenshot

image

Logs

api_info.ts:422 Too many arguments provided for the endpoint.
ns @ api_info.ts:422
Rs @ submit.ts:72
qe @ Blocks.svelte:344
be @ Blocks.svelte:301
Sl @ Blocks.svelte:294
await in Sl
At @ Blocks.svelte:218
(anonymous) @ Blocks.svelte:644
requestAnimationFrame
(anonymous) @ Blocks.svelte:643
(anonymous) @ Blocks.svelte:642
dispatch @ utils.ts:265
V @ Index.svelte:93
(anonymous) @ svelte.js:1966
(anonymous) @ svelte.js:1965
we @ Textbox.svelte:123
api_info.ts:422 Too many arguments provided for the endpoint.
ns @ api_info.ts:422
Rs @ submit.ts:72
qe @ Blocks.svelte:344
be @ Blocks.svelte:301
Sl @ Blocks.svelte:294
await in Sl
(anonymous) @ Blocks.svelte:212
Promise.then
(anonymous) @ Blocks.svelte:211
n @ index.js:56
V @ init.ts:360
requestAnimationFrame
R @ init.ts:370
Cl @ Blocks.svelte:115
Zs @ Blocks.svelte:388
qe @ Blocks.svelte:371
await in qe
be @ Blocks.svelte:301
Sl @ Blocks.svelte:294
await in Sl
At @ Blocks.svelte:218
(anonymous) @ Blocks.svelte:644
requestAnimationFrame
(anonymous) @ Blocks.svelte:643
(anonymous) @ Blocks.svelte:642
dispatch @ utils.ts:265
V @ Index.svelte:93
(anonymous) @ svelte.js:1966
(anonymous) @ svelte.js:1965
we @ Textbox.svelte:123
Show 1 more frame
Show less
api_info.ts:422 Too many arguments provided for the endpoint.
ns @ api_info.ts:422
Rs @ submit.ts:72
qe @ Blocks.svelte:344
be @ Blocks.svelte:301
Sl @ Blocks.svelte:294
await in Sl
(anonymous) @ Blocks.svelte:212
Promise.then
(anonymous) @ Blocks.svelte:211
n @ index.js:56
V @ init.ts:360
requestAnimationFrame
R @ init.ts:370
(anonymous) @ Blocks.svelte:607
(anonymous) @ RenderComponent.svelte:37
(anonymous) @ svelte.js:3273
Q @ Index.svelte:67
g @ Index.svelte:62
(anonymous) @ svelte.js:3273
(anonymous) @ Textbox.svelte:78
flush @ svelte.js:2141
Promise.then
schedule_update @ svelte.js:2062
make_dirty @ svelte.js:3216
(anonymous) @ svelte.js:3274
(anonymous) @ Blocks.svelte:65
n @ index.js:56
i @ index.js:69
V @ init.ts:337
requestAnimationFrame
R @ init.ts:370
Cl @ Blocks.svelte:115
Zs @ Blocks.svelte:388
qe @ Blocks.svelte:371
await in qe
be @ Blocks.svelte:301
Sl @ Blocks.svelte:294
await in Sl
At @ Blocks.svelte:218
(anonymous) @ Blocks.svelte:644
requestAnimationFrame
(anonymous) @ Blocks.svelte:643
(anonymous) @ Blocks.svelte:642
dispatch @ utils.ts:265
V @ Index.svelte:93
(anonymous) @ svelte.js:1966
(anonymous) @ svelte.js:1965
we @ Textbox.svelte:123
Show 3 more frames
Show less

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 5.4.0
gradio_client version: 1.4.2

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.6.2.post1
audioop-lts is not installed.
fastapi: 0.115.4
ffmpy: 0.4.0
gradio-client==1.4.2 is not installed.
httpx: 0.27.2
huggingface-hub: 0.26.2
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.1.3
orjson: 3.10.11
packaging: 24.1
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.9.2
pydub: 0.25.1
python-multipart==0.0.12 is not installed.
pyyaml: 6.0.2
ruff: 0.7.2
safehttpx: 0.1.1
semantic-version: 2.10.0
starlette: 0.41.2
tomlkit==0.12.0 is not installed.
typer: 0.12.5
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.32.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.27.2
huggingface-hub: 0.26.2
packaging: 24.1
typing-extensions: 4.12.2
websockets: 12.0

Severity

I can work around it

ROBERT-MCDOWELL commented 1 day ago

same here with simple checkbox and JSON objects