Download app.py from ctran/X: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/spaces/ctran/X/resolve/main/app.py
- Command line
-
hf download hf://spaces/ctran/X/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ctran/X/resolve/main/app.py
895 Bytes
| import gradio as gr | |
| from gradio_buttontip import ButtonTip | |
| def button_click(): | |
| return "Button clicked!" | |
| demo = gr.Interface( | |
| title="Button with Tooltip", | |
| description="This interface showcases a button with a tooltip.", | |
| fn=button_click, | |
| inputs=[ | |
| ButtonTip( | |
| tooltip="Tooltip Text", | |
| tooltip_color="white", # Custom color | |
| tooltip_background_color="red", | |
| x=120, # No horizontal offset | |
| y=-20, # Above the button | |
| value="Top Button" | |
| ), | |
| ButtonTip( | |
| tooltip="Tooltip Text", | |
| tooltip_color="white", # Custom color | |
| tooltip_background_color="green", | |
| x=140, # No horizontal offset | |
| y=20, # Below the button | |
| value="Bottom Button" | |
| ) | |
| ], | |
| outputs="text", | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() | |