Spaces:
Runtime error
Runtime error
Fix displaying output for first example
Browse filesDue to the way Gradio caching works, the previous code failed
without a cache.
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from dataclasses import dataclass
|
2 |
from operator import add, sub
|
3 |
|
@@ -88,8 +89,6 @@ button.gallery-item { color: var(--body-text-color) !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,
|
95 |
theme=gr.themes.Monochrome(radius_size=gr.themes.sizes.radius_sm),
|
@@ -105,16 +104,10 @@ with gr.Blocks(
|
|
105 |
"from the [GloVe](https://nlp.stanford.edu/projects/glove/) dataset."
|
106 |
)
|
107 |
with gr.Row():
|
108 |
-
gr.Examples(
|
109 |
-
examples,
|
110 |
-
inputs=input,
|
111 |
-
cache_examples=True,
|
112 |
-
outputs=output,
|
113 |
-
fn=get_results,
|
114 |
-
)
|
115 |
|
116 |
with gr.Column():
|
117 |
-
output.
|
118 |
|
119 |
btn.click(fn=get_results, inputs=input, outputs=output)
|
120 |
|
|
|
1 |
+
import os
|
2 |
from dataclasses import dataclass
|
3 |
from operator import add, sub
|
4 |
|
|
|
89 |
.confidence-set:hover .label { color: var(--color-red-700) !important; }
|
90 |
"""
|
91 |
|
|
|
|
|
92 |
with gr.Blocks(
|
93 |
css=css,
|
94 |
theme=gr.themes.Monochrome(radius_size=gr.themes.sizes.radius_sm),
|
|
|
104 |
"from the [GloVe](https://nlp.stanford.edu/projects/glove/) dataset."
|
105 |
)
|
106 |
with gr.Row():
|
107 |
+
gr.Examples(examples, inputs=input)
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
with gr.Column():
|
110 |
+
output = gr.Label(label="Closest words", value=initial_output)
|
111 |
|
112 |
btn.click(fn=get_results, inputs=input, outputs=output)
|
113 |
|