Spaces:
Runtime error
Runtime error
Display output for first example on launch
Browse files
app.py
CHANGED
@@ -76,8 +76,11 @@ examples = [
|
|
76 |
"king - man + woman",
|
77 |
"mother - woman + man",
|
78 |
"berlin - germany + france",
|
|
|
79 |
]
|
80 |
|
|
|
|
|
81 |
css = """
|
82 |
button.gallery-item { color: var(--body-text-color) !important; }
|
83 |
.output-class { color: var(--color-red-700) !important; }
|
@@ -85,7 +88,7 @@ button.gallery-item { color: var(--body-text-color) !important; }
|
|
85 |
.confidence-set:hover .label { color: var(--color-red-700) !important; }
|
86 |
"""
|
87 |
|
88 |
-
output = gr.Label(label="Closest words")
|
89 |
|
90 |
with gr.Blocks(
|
91 |
css=css,
|
@@ -98,7 +101,8 @@ with gr.Blocks(
|
|
98 |
btn = gr.Button("Run", variant="primary")
|
99 |
with gr.Row():
|
100 |
gr.Markdown(
|
101 |
-
"Demonstration of computing cosine similarity of embeddings
|
|
|
102 |
)
|
103 |
with gr.Row():
|
104 |
gr.Examples(
|
|
|
76 |
"king - man + woman",
|
77 |
"mother - woman + man",
|
78 |
"berlin - germany + france",
|
79 |
+
"saxophone - jazz + classical",
|
80 |
]
|
81 |
|
82 |
+
initial_output = get_results(examples[0])
|
83 |
+
|
84 |
css = """
|
85 |
button.gallery-item { color: var(--body-text-color) !important; }
|
86 |
.output-class { color: var(--color-red-700) !important; }
|
|
|
88 |
.confidence-set:hover .label { color: var(--color-red-700) !important; }
|
89 |
"""
|
90 |
|
91 |
+
output = gr.Label(label="Closest words", value=initial_output)
|
92 |
|
93 |
with gr.Blocks(
|
94 |
css=css,
|
|
|
101 |
btn = gr.Button("Run", variant="primary")
|
102 |
with gr.Row():
|
103 |
gr.Markdown(
|
104 |
+
"Demonstration of computing cosine similarity of embeddings "
|
105 |
+
"from the [GloVe](https://nlp.stanford.edu/projects/glove/) dataset."
|
106 |
)
|
107 |
with gr.Row():
|
108 |
gr.Examples(
|