innocent-charles
commited on
Commit
•
75adcb0
1
Parent(s):
4297bcd
Update app.py
Browse files
app.py
CHANGED
@@ -39,16 +39,10 @@ sentence_to_compare_inputs = [
|
|
39 |
gr.Textbox(lines=2, placeholder="Enter the sentence you want to compare...", label="Sentence to Compare 3")
|
40 |
]
|
41 |
|
42 |
-
num_sentences_input = gr.Slider(minimum=1, maximum=10, step=1, value=3, label="Number of Sentences to Compare")
|
43 |
outputs = gr.JSON(label="Detailed Similarity Scores")
|
44 |
|
45 |
-
# Function to dynamically update the interface
|
46 |
-
def update_interface(num_sentences):
|
47 |
-
return [gr.Textbox(lines=2, placeholder="Enter the sentence you want to compare...", label=f"Sentence to Compare {i}") for i in range(1, num_sentences + 1)]
|
48 |
-
|
49 |
def create_interface():
|
50 |
-
inputs_dynamic = [model_name_display, original_sentence_input,
|
51 |
-
inputs_dynamic += update_interface(3)
|
52 |
return gr.Interface(
|
53 |
fn=predict,
|
54 |
title="African Cross-Lingua Embeddings Model's Demo",
|
|
|
39 |
gr.Textbox(lines=2, placeholder="Enter the sentence you want to compare...", label="Sentence to Compare 3")
|
40 |
]
|
41 |
|
|
|
42 |
outputs = gr.JSON(label="Detailed Similarity Scores")
|
43 |
|
|
|
|
|
|
|
|
|
44 |
def create_interface():
|
45 |
+
inputs_dynamic = [model_name_display, original_sentence_input, sentence_to_compare_inputs]
|
|
|
46 |
return gr.Interface(
|
47 |
fn=predict,
|
48 |
title="African Cross-Lingua Embeddings Model's Demo",
|