I’m going to mess with this task as well, because I think I’ve tried before incorporating a dropdown with this method, and was having trouble. I think the dropdown needs to target a function that points to the model, rather than the model. Another option to keep on the board is gradio.Interface.from_pipeline(). I’ll copy you if you get it figured out xD
It worked! I had actually given up on using a dropdown to select gradio.Interface.load() some time ago. Following @abidlabs example and changing:
models = [
“models/Repo/Name”,
]
to:
models=[
gradio.Interface.load(“models/Repo/Name”),
]
made it happen. Thanks for asking this question and check it out:
with gr.Blocks() as demo:
model_choice = gr.Dropdown(choices=[m for m in model_box], type=“index”, value=current_model)
input_text=gr.Textbox()
output_window=gr.Image()
the_button=gr.Button()
Right on, I learned a lot here too.
That example I just left is trash for anybody following along, and nobody should use it. XD
Here is an example space employing “Gradio Dropdown to Select Interface.load(models)” to remember this journey