Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -193,7 +193,7 @@ function uploadImage(image, event, source, value) {
|
|
193 |
}
|
194 |
return;
|
195 |
}
|
196 |
-
function
|
197 |
let envInfo = getEnvInfo();
|
198 |
console.log(envInfo);
|
199 |
if (isValidEnv()){
|
@@ -234,6 +234,6 @@ with gr.Blocks(css=css, head=js) as demo:
|
|
234 |
|
235 |
image_input.change(fn=lambda x:x , inputs=[image_input], outputs=[gr.State([])], js='''(img)=>window.uploadImage(img,"process_finished","demo_hf_deepnude_gan_card", "")''')
|
236 |
process_button.click(update_status, inputs=image_input, outputs=image_input, js='''(i) => window.postMessageToParent(i, "process_started", "demo_hf_deepnude_gan_card", "click_nude")''')
|
237 |
-
demo.load(fn=lambda x:x, inputs=[gr.State([])], outputs=[gr.State([])], js='''(x)=>onDemoLoad(x)''')
|
238 |
demo.queue(max_size=10)
|
239 |
demo.launch()
|
|
|
193 |
}
|
194 |
return;
|
195 |
}
|
196 |
+
window.onDemoLoad = function(x){
|
197 |
let envInfo = getEnvInfo();
|
198 |
console.log(envInfo);
|
199 |
if (isValidEnv()){
|
|
|
234 |
|
235 |
image_input.change(fn=lambda x:x , inputs=[image_input], outputs=[gr.State([])], js='''(img)=>window.uploadImage(img,"process_finished","demo_hf_deepnude_gan_card", "")''')
|
236 |
process_button.click(update_status, inputs=image_input, outputs=image_input, js='''(i) => window.postMessageToParent(i, "process_started", "demo_hf_deepnude_gan_card", "click_nude")''')
|
237 |
+
demo.load(fn=lambda x:x, inputs=[gr.State([])], outputs=[gr.State([])], js='''(x)=>window.onDemoLoad(x)''')
|
238 |
demo.queue(max_size=10)
|
239 |
demo.launch()
|