Hnabil commited on
Commit
ccdd002
1 Parent(s): f4aee76

Initiate demo on page load

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -113,14 +113,15 @@ with gr.Blocks(title=title) as demo:
113
  plot = gr.Plot(label="Original data")
114
  fn = partial(plot_data, tsne=False)
115
  input_data.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
116
- perplexity.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
117
  n_samples.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
 
118
  with gr.Column():
119
  plot = gr.Plot(label="t-SNE")
120
  fn = partial(plot_data, tsne=True)
121
  input_data.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
122
  perplexity.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
123
  n_samples.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
 
124
 
125
 
126
  demo.launch()
 
113
  plot = gr.Plot(label="Original data")
114
  fn = partial(plot_data, tsne=False)
115
  input_data.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
 
116
  n_samples.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
117
+ demo.load(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
118
  with gr.Column():
119
  plot = gr.Plot(label="t-SNE")
120
  fn = partial(plot_data, tsne=True)
121
  input_data.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
122
  perplexity.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
123
  n_samples.change(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
124
+ demo.load(fn=fn, inputs=[input_data, perplexity, n_samples], outputs=plot)
125
 
126
 
127
  demo.launch()