andreska commited on
Commit
016c4cb
·
verified ·
1 Parent(s): 3065a47

Try set data on init

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -35,6 +35,12 @@ with gr.Blocks() as iface:
35
  outputs=output
36
  )
37
 
 
 
 
 
 
 
38
  iface.launch(
39
  server_name="0.0.0.0", # Allow external connections
40
  share=True, # Create public URL
 
35
  outputs=output
36
  )
37
 
38
+ iface.load(lambda: window.addEventListener('message', (event) => {
39
+ if (event.data.type === 'initial_input') {
40
+ iface.update(inputs=[event.data.project_data, event.data.question])
41
+ }
42
+ }))
43
+
44
  iface.launch(
45
  server_name="0.0.0.0", # Allow external connections
46
  share=True, # Create public URL