ccm commited on
Commit
68742f5
·
1 Parent(s): eafa610

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -178,6 +178,11 @@ def simple_synthesis(index):
178
  pred, true = net.synthesis(index)
179
  return plotly_fig(pred), plotly_fig(true)
180
 
 
 
 
 
 
181
  import plotly.graph_objects as go
182
  import numpy as np
183
 
@@ -262,7 +267,7 @@ with gradio.Blocks() as synthesis_demo2:
262
  with gradio.Column():
263
  true = gradio.Plot(label="True")
264
 
265
- btn2.click(fn=synthesis_from_spectrum, inputs=[num], outputs=[pred, true])
266
 
267
  all_synthesis_demos = gradio.TabbedInterface([synthesis_demo, synthesis_demo2], ["Spectrum from Data", "Spectrum from File"])
268
 
 
178
  pred, true = net.synthesis(index)
179
  return plotly_fig(pred), plotly_fig(true)
180
 
181
+ def synthesis_from_spectrum(df):
182
+ net = Network("16inverse_structure.json", "16inverse_weights.h5")
183
+ pred = net.synthesis(df.to_numpy())
184
+ return plotly_fig(pred)
185
+
186
  import plotly.graph_objects as go
187
  import numpy as np
188
 
 
267
  with gradio.Column():
268
  true = gradio.Plot(label="True")
269
 
270
+ btn2.click(fn=synthesis_from_spectrum, inputs=[perf], outputs=[pred, true])
271
 
272
  all_synthesis_demos = gradio.TabbedInterface([synthesis_demo, synthesis_demo2], ["Spectrum from Data", "Spectrum from File"])
273