Sergidev commited on
Commit
d7977e8
·
verified ·
1 Parent(s): 66e1050

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -43,7 +43,7 @@ def compare_embeddings(*texts):
43
  return fig
44
 
45
  def generate_text_boxes(n):
46
- return [gr.Textbox(label=f"Text {i+1}") for i in range(n)]
47
 
48
  with gr.Blocks() as iface:
49
  gr.Markdown("# 3D Embedding Comparison")
@@ -59,7 +59,7 @@ with gr.Blocks() as iface:
59
  compare_button = gr.Button("Compare Embeddings")
60
 
61
  def update_interface(n):
62
- return [gr.Textbox.update(visible=True) for _ in range(n)] + [gr.Textbox.update(visible=False) for _ in range(10-n)]
63
 
64
  num_texts.change(
65
  update_interface,
 
43
  return fig
44
 
45
  def generate_text_boxes(n):
46
+ return [gr.Textbox(label=f"Text {i+1}", visible=(i < n)) for i in range(10)]
47
 
48
  with gr.Blocks() as iface:
49
  gr.Markdown("# 3D Embedding Comparison")
 
59
  compare_button = gr.Button("Compare Embeddings")
60
 
61
  def update_interface(n):
62
+ return [gr.update(visible=(i < n)) for i in range(10)]
63
 
64
  num_texts.change(
65
  update_interface,