Spaces:
Sleeping
Sleeping
try fix error
Browse files
app.py
CHANGED
|
@@ -15,10 +15,13 @@ iface = gr.Interface(
|
|
| 15 |
outputs="text"
|
| 16 |
)
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
iface.launch()
|
|
|
|
| 15 |
outputs="text"
|
| 16 |
)
|
| 17 |
|
| 18 |
+
# Listen for initial input message
|
| 19 |
+
def listen_for_messages():
|
| 20 |
+
window.addEventListener('message', (event) => {
|
| 21 |
+
if event.data.type === 'initial_input':
|
| 22 |
+
iface.update(inputs=[event.data.project_data, event.data.question])
|
| 23 |
+
})
|
| 24 |
+
|
| 25 |
+
iface.load(listen_for_messages) # Call the defined function
|
| 26 |
|
| 27 |
iface.launch()
|