ginipick commited on
Commit
5d7fe5c
·
verified ·
1 Parent(s): cbc2346

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -146,9 +146,9 @@ def create_ui():
146
 
147
  with gr.Column(scale=1):
148
  info_output = gr.Textbox(label="Space 정보 및 요약", lines=20)
 
149
  screenshot_output = gr.Image(type="pil", label="Live 화면", height=360, width=600)
150
  app_py_content = gr.Code(language="python", label="메인 소스코드")
151
- url_state = gr.State("")
152
 
153
  for _, button, space in space_rows:
154
  button.click(
@@ -157,7 +157,12 @@ def create_ui():
157
  outputs=[info_output, app_py_content, url_state]
158
  )
159
 
160
- demo.load(update_screenshot, inputs=[url_state], outputs=[screenshot_output], every=5)
 
 
 
 
 
161
 
162
  return demo
163
 
 
146
 
147
  with gr.Column(scale=1):
148
  info_output = gr.Textbox(label="Space 정보 및 요약", lines=20)
149
+ url_state = gr.Textbox(visible=False)
150
  screenshot_output = gr.Image(type="pil", label="Live 화면", height=360, width=600)
151
  app_py_content = gr.Code(language="python", label="메인 소스코드")
 
152
 
153
  for _, button, space in space_rows:
154
  button.click(
 
157
  outputs=[info_output, app_py_content, url_state]
158
  )
159
 
160
+ url_state.change(
161
+ update_screenshot,
162
+ inputs=[url_state],
163
+ outputs=[screenshot_output],
164
+ every=5
165
+ )
166
 
167
  return demo
168