Update app.py
Browse files
app.py
CHANGED
@@ -52,19 +52,19 @@ with gr.Blocks() as iface:
|
|
52 |
num_texts = gr.Slider(minimum=2, maximum=10, step=1, value=2, label="Number of texts to compare")
|
53 |
|
54 |
with gr.Column() as input_column:
|
55 |
-
text_boxes =
|
56 |
|
57 |
output = gr.Plot()
|
58 |
|
59 |
compare_button = gr.Button("Compare Embeddings")
|
60 |
|
61 |
def update_interface(n):
|
62 |
-
return gr.
|
63 |
|
64 |
num_texts.change(
|
65 |
update_interface,
|
66 |
inputs=[num_texts],
|
67 |
-
outputs=
|
68 |
)
|
69 |
|
70 |
compare_button.click(
|
|
|
52 |
num_texts = gr.Slider(minimum=2, maximum=10, step=1, value=2, label="Number of texts to compare")
|
53 |
|
54 |
with gr.Column() as input_column:
|
55 |
+
text_boxes = generate_text_boxes(2)
|
56 |
|
57 |
output = gr.Plot()
|
58 |
|
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,
|
66 |
inputs=[num_texts],
|
67 |
+
outputs=text_boxes
|
68 |
)
|
69 |
|
70 |
compare_button.click(
|