freddyaboulton / gradio-leaderboard

Super fast , batteries included Leaderboard component ⚡️
1 stars 2 forks source link

It is not possible to select the maximum on the slider #15

Open erumoico opened 2 months ago

erumoico commented 2 months ago

Hi! I found that for some ranges it is not possible to select the maximum on the slider. Maybe it's because of the selected slider step. Anyway, I think a simple solution would be to add some constant to the maximum (i.e. max() + 10). Whether the problem is with the minimum, I don't know. But to be sure, it would be good to do the same thing with the minimum (i.e. min() - 10).

The ColumnFilter class has a max and min attribute, but these are not used for the type attribute with the "slider" value. The max and min attributes are overridden by the calculated value in the max_val and min_val variables.

https://github.com/freddyaboulton/gradio-leaderboard/blob/5075f94546c101d9e2741d4f985c67f06b78a2bc/backend/gradio_leaderboard/leaderboard.py#L44-L54

https://github.com/freddyaboulton/gradio-leaderboard/blob/5075f94546c101d9e2741d4f985c67f06b78a2bc/backend/gradio_leaderboard/leaderboard.py#L209-L216

https://github.com/freddyaboulton/gradio-leaderboard/blob/5075f94546c101d9e2741d4f985c67f06b78a2bc/backend/gradio_leaderboard/leaderboard.py#L233-L235

freddyaboulton commented 2 months ago

Would you like to open a PR @erumoico ? Thank you!