-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
422 - Strange fields required, does not allow for custom input #5601
Comments
Can you provide more information on why you can only use version 2.9.4? I'm afraid this version is no longer maintained and it will be difficult to figure out or fix what is happening here. Not only is the current version 3.x but we also working on 4.x and have no plans to maintain previous major versions unfortunately. |
The reason for using 2.9.4 is because I plan to use gradio in an offline/airgapped environment. Gradio 3 is unable to support working in such an environment as it needs to pull in fonts, css, js from a CDN. |
Hmm. I thought we mostly fixed this issue. Does gradio not work at all offline for you or is it just certain components? |
Not at all, no. Admittedly this is more of how my colleagues have tested it but the environment is gradio 2.9.4 and there are no plans to upgrade it unless it can work offline. Believe the issue is still open? #1450 |
We'll get that fixed as soon as we can, we don't want people downgrading for this reason. New gradio is lots better! |
Thanks @LifeBoey ! Looks like you're using pydantic version 2, which is only supported on recent versions of gradio. Please downgrade to version 1. Also, the API expects the input data to be passed in a list on the "data" key of the json object. You can get info on how to use the API by clicking the After making those two changes, the api works for me Let's close this out since it's tracked by #1450. |
Describe the bug
Hi there, I am currently learning how to use gradio by using a simple example.
I am unable to use gradio as intended, and trying to rectify the errors as intended as led me to a rather restrictive use of gradio where I cannot submit any custom inputs to be processed.
Launching the app led to a problem where it would not accept any input except for a particular format as shown in the reproduction; with a 'naive' way of requesting it would return a 422 error with some very strange fields required that I don't know why they're required.
Changing this to the new request as show in the reproduction would also result in an error of NoneType having no index; the basic problem being that the interface is not initiated with examples, and the example_id is overriding any data provided.
When the interface is initiated with examples, say with examples=['Mary'], the request does return a 200 response, but because of the example_id override, it returns "Hello Mary!" instead of "Hello John!"
I'd like to find out how to rectify this issue so that I can pass in my own input into the gradio app without the need for examples.
Have you searched existing issues? 🔎
Reproduction
Code of app launched:
Code of naive request launched:
Code of changed request launched:
Screenshot
Error when using the gradio UI directly:
Logs
No response
System Info
Here due to the circumstances of the gradio version to use I can only use gradio version 2.9.4. At first I was facing an issue prescribed in https://github.com/gradio-app/gradio/issues/1203 but I managed to fix it as per the solution inside it.
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: