karmiq commited on
Commit
475c76c
·
1 Parent(s): b4d5bf8

Display output for first example on launch

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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 from the [GloVe](https://nlp.stanford.edu/projects/glove/) dataset."
 
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(