Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,10 @@ get_window_url_params = """
|
|
13 |
return [text_input, url_params];
|
14 |
}
|
15 |
"""
|
|
|
16 |
get_window_url_params_s = """
|
17 |
function(url_params) {
|
18 |
-
console.log(
|
19 |
const params = new URLSearchParams(window.location.search);
|
20 |
url_params = Object.fromEntries(params);
|
21 |
return [url_params];
|
@@ -41,8 +42,9 @@ with gr.Blocks() as block:
|
|
41 |
btn2 = gr.Button("Set Params")
|
42 |
btn2.click(fn=predict, inputs=[text_input, url_params],
|
43 |
outputs=[text_output, url_params], _js=set_window_url_params)
|
|
|
44 |
block.load(
|
45 |
-
fn=
|
46 |
inputs=[url_params],
|
47 |
outputs=[url_params],
|
48 |
_js=get_window_url_params_s
|
|
|
13 |
return [text_input, url_params];
|
14 |
}
|
15 |
"""
|
16 |
+
|
17 |
get_window_url_params_s = """
|
18 |
function(url_params) {
|
19 |
+
console.log(url_params);
|
20 |
const params = new URLSearchParams(window.location.search);
|
21 |
url_params = Object.fromEntries(params);
|
22 |
return [url_params];
|
|
|
42 |
btn2 = gr.Button("Set Params")
|
43 |
btn2.click(fn=predict, inputs=[text_input, url_params],
|
44 |
outputs=[text_output, url_params], _js=set_window_url_params)
|
45 |
+
|
46 |
block.load(
|
47 |
+
fn=lambda x:x,
|
48 |
inputs=[url_params],
|
49 |
outputs=[url_params],
|
50 |
_js=get_window_url_params_s
|