Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,16 +53,15 @@ def fetch_personalized_data(session_index):
|
|
| 53 |
print(f"Error: {err}")
|
| 54 |
return None
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
"""
|
| 64 |
|
| 65 |
-
with gr.Blocks() as demo:
|
| 66 |
gr.Markdown("""## Gradio send queryparam to chatbot
|
| 67 |
type `hi`
|
| 68 |
""")
|
|
@@ -112,12 +111,6 @@ with gr.Blocks() as demo:
|
|
| 112 |
|
| 113 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 114 |
|
| 115 |
-
|
| 116 |
-
fn=lambda x: x,
|
| 117 |
-
inputs=[url_params],
|
| 118 |
-
outputs=[url_params],
|
| 119 |
-
_js=get_window_url_params(),
|
| 120 |
-
queue=False
|
| 121 |
-
)
|
| 122 |
|
| 123 |
demo.launch()
|
|
|
|
| 53 |
print(f"Error: {err}")
|
| 54 |
return None
|
| 55 |
|
| 56 |
+
js = """
|
| 57 |
+
function() {
|
| 58 |
+
const params = new URLSearchParams(window.location.search);
|
| 59 |
+
const url_params = Object.fromEntries(params);
|
| 60 |
+
return url_params;
|
| 61 |
+
}
|
| 62 |
+
"""
|
|
|
|
| 63 |
|
| 64 |
+
with gr.Blocks(js = js) as demo:
|
| 65 |
gr.Markdown("""## Gradio send queryparam to chatbot
|
| 66 |
type `hi`
|
| 67 |
""")
|
|
|
|
| 111 |
|
| 112 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 113 |
|
| 114 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
demo.launch()
|