Genis commited on
Commit
54655ba
·
verified ·
1 Parent(s): feccf0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -100,7 +100,10 @@ def predict(image):
100
  def export(password):
101
  if password == os.getenv('EXPORT_PASSWORD'):
102
  m.export_model()
103
- return [[gr.update(visible=True), file] for file in [f'model.pickle', f'requirements.txt', f'ModelCreator.py']]
 
 
 
104
  else:
105
  return [None, f'Subscribe to Patreon to Download']*3
106
 
@@ -125,6 +128,6 @@ with gr.Blocks() as demo:
125
  out4 = gr.File(label='Download link', visible=True, height=30, interactive=False)
126
  out5 = gr.File(label='Download link', visible=True, height=30, interactive=False)
127
  btn3 = gr.Button("Export Fitted Model")
128
- btn3.click(fn=export, inputs=inp3, outputs=[[out3, out3],[out4, out4],[out5, out5]])
129
  gr.Markdown(markdown_tail)
130
  demo.launch()
 
100
  def export(password):
101
  if password == os.getenv('EXPORT_PASSWORD'):
102
  m.export_model()
103
+ outs = []
104
+ for file in [f'model.pickle', f'requirements.txt', f'ModelCreator.py']:
105
+ outs += [gr.update(visible=True), file]
106
+ return outs
107
  else:
108
  return [None, f'Subscribe to Patreon to Download']*3
109
 
 
128
  out4 = gr.File(label='Download link', visible=True, height=30, interactive=False)
129
  out5 = gr.File(label='Download link', visible=True, height=30, interactive=False)
130
  btn3 = gr.Button("Export Fitted Model")
131
+ btn3.click(fn=export, inputs=inp3, outputs=[out3, out3, out4, out4, out5, out5])
132
  gr.Markdown(markdown_tail)
133
  demo.launch()