simonduerr commited on
Commit
f2a6220
·
verified ·
1 Parent(s): abe6512

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -45,14 +45,16 @@ with gr.Blocks() as demo:
45
  chains = gr.Textbox("chainsResult", label="Chains", visible=False)
46
  hidden_style = gr.Textbox(visible=False)
47
 
48
- btn = gr.Button("Vectorize")
 
49
  html = gr.HTML("")
50
  out_file = gr.File(label="Download SVG")
51
  btn.click(None, style, [view_str, chains, hidden_style], js="(style) => [document.getElementById('viewMatrixResult').value, document.getElementById('chains').value, style]") #
 
52
  # on change of chains trigger, rendering
53
- view_str.change(predict, [inp, style, view_str, chains], [html, out_file])
54
- chains.change(predict, [inp, style, view_str, chains], [html, out_file])
55
- hidden_style.change(predict, [inp, style, view_str, chains], [html, out_file])
56
 
57
 
58
  if __name__ == "__main__":
 
45
  chains = gr.Textbox("chainsResult", label="Chains", visible=False)
46
  hidden_style = gr.Textbox(visible=False)
47
 
48
+ btn = gr.Button("1. Save state")
49
+ btn2 = gr.Button("2. Vectorize")
50
  html = gr.HTML("")
51
  out_file = gr.File(label="Download SVG")
52
  btn.click(None, style, [view_str, chains, hidden_style], js="(style) => [document.getElementById('viewMatrixResult').value, document.getElementById('chains').value, style]") #
53
+ btn2.click(predict, [inp, style, view_str, chains], [html, out_file])
54
  # on change of chains trigger, rendering
55
+ # view_str.change(predict, [inp, style, view_str, chains], [html, out_file])
56
+ # chains.change(predict, [inp, style, view_str, chains], [html, out_file])
57
+ # hidden_style.change(predict, [inp, style, view_str, chains], [html, out_file])
58
 
59
 
60
  if __name__ == "__main__":