akhaliq HF staff commited on
Commit
71513ed
1 Parent(s): 0285458
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -25,10 +25,11 @@ def create_interface(model_name, src_registry, **kwargs):
25
 
26
  def update_model(new_model, container, src_registry, **kwargs):
27
  with container:
28
- container.visible = False # Hide current content
 
 
29
  new_interface = create_interface(new_model, src_registry, **kwargs)
30
  new_interface.render()
31
- container.visible = True # Show new content
32
 
33
  with gr.Blocks(fill_height=True) as demo:
34
  # Meta Llama Tab
 
25
 
26
  def update_model(new_model, container, src_registry, **kwargs):
27
  with container:
28
+ # Clear existing content first
29
+ container.clear()
30
+ # Create and render new interface
31
  new_interface = create_interface(new_model, src_registry, **kwargs)
32
  new_interface.render()
 
33
 
34
  with gr.Blocks(fill_height=True) as demo:
35
  # Meta Llama Tab