Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -13,15 +13,6 @@ get_window_url_params = """
|
|
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];
|
23 |
-
}
|
24 |
-
"""
|
25 |
set_window_url_params = """
|
26 |
function(text_input, url_params) {
|
27 |
const state = {text_input:text_input}
|
@@ -42,11 +33,10 @@ with gr.Blocks() as block:
|
|
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=
|
48 |
-
inputs=[url_params],
|
49 |
-
outputs=[url_params],
|
50 |
-
_js=
|
51 |
)
|
52 |
block.launch(debug=True)
|
|
|
13 |
return [text_input, url_params];
|
14 |
}
|
15 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
set_window_url_params = """
|
17 |
function(text_input, url_params) {
|
18 |
const state = {text_input:text_input}
|
|
|
33 |
btn2 = gr.Button("Set Params")
|
34 |
btn2.click(fn=predict, inputs=[text_input, url_params],
|
35 |
outputs=[text_output, url_params], _js=set_window_url_params)
|
|
|
36 |
block.load(
|
37 |
+
fn=predict,
|
38 |
+
inputs=[text_input, url_params],
|
39 |
+
outputs=[text_output, url_params],
|
40 |
+
_js=get_window_url_params
|
41 |
)
|
42 |
block.launch(debug=True)
|