Using the prompt to switch model

Hello,

I am new to gradio and tried to implement a way to switch models by identifying keyword inside the prompt

see

the problem seems to be that whatever is selected
it is ignored by gradio

Can someone explain, what is wrong in my code
and if this is feasible or not?

Thanks