| import gradio as gr |
|
|
| def handle_link_click(link): |
| |
| |
| import webbrowser |
| webbrowser.open(link) |
|
|
| with gr.Blocks( |
| theme=gr.themes.Soft(secondary_hue=gr.themes.colors.sky,neutral_hue=gr.themes.colors.stone) |
| ) as demo: |
| with gr.Row(): |
| |
| link1 = gr.Button("Tool1") |
| link2 = gr.Button("Tool2") |
| link3 = gr.Button("Translate Tool") |
|
|
| |
| link1.click(fn=lambda: handle_link_click("https://nicedata.eu.org/tool-language")) |
| link2.click(fn=lambda: handle_link_click("https://nicedata.eu.org/")) |
| link3.click(fn=lambda: handle_link_click("https://nicedata.eu.org/tool2")) |
|
|
|
|
| if __name__ == "__main__": |
| demo.launch(server_name="localhost", server_port=5008, share=True) |