Prevent gradio_client
from sending out of range value for gr.Slider
#3878
Labels
enhancement
New feature or request
When using
gr.Slider
, users can restrict the possible input values withminimum, maximum, step
. For example, we can limit the value to multiples of 5 from 0 to 100 by doinggr.Slider(minimum=0, maximum=100, step=5, value=0)
, but currentlyClient
can send arbitrary values, like1000000
or1.23
, ignoring this restriction.This is problematic, for example, when the batch size is set with
gr.Slider
.Client
can send a value like 100, which would probably cause GPU OOM and crash the Space. Once GPU OOM occurs, a Space will stop working properly until manually restarted.I guess Space developers can add some logic in their functions to reject unacceptable values, but it will increase their work. So, it would be nice if it was taken care of on gradio side.
The text was updated successfully, but these errors were encountered: