|
import gradio as gr |
|
|
|
|
|
def app1(input): |
|
|
|
pass |
|
|
|
def app2(input): |
|
|
|
pass |
|
|
|
def app3(input): |
|
|
|
pass |
|
|
|
def app4(input): |
|
|
|
pass |
|
|
|
|
|
iface1 = gr.Interface(fn=app1, inputs="textbox", outputs="textbox") |
|
iface2 = gr.Interface(fn=app2, inputs="textbox", outputs="textbox") |
|
iface3 = gr.Interface(fn=app3, inputs="textbox", outputs="textbox") |
|
iface4 = gr.Interface(fn=app4, inputs="textbox", outputs="textbox") |
|
|
|
|
|
def switch_app(input, choice): |
|
if choice == 'Applicazione 1': |
|
return iface1.process(input) |
|
elif choice == 'Applicazione 2': |
|
return iface2.process(input) |
|
elif choice == 'Applicazione 3': |
|
return iface3.process(input) |
|
elif choice == 'Applicazione 4': |
|
return iface4.process(input) |
|
|
|
|
|
iface = gr.Interface(fn=switch_app, |
|
inputs=["textbox", gr.inputs.Radio(['Applicazione 1', 'Applicazione 2', 'Applicazione 3', 'Applicazione 4'])], |
|
outputs="textbox") |
|
|
|
iface.launch() |
|
|