Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| def echo(text, request: gr.Request): | |
| if request: | |
| print("Request headers dictionary:", request.headers) | |
| print("IP address:", request.client.host) | |
| print("Query parameters:", dict(request.query_params)) | |
| return text | |
| with gr.Blocks() as demo: | |
| text_1 = gr.Textbox() | |
| text_2 = gr.Textbox() | |
| demo.load( | |
| echo, | |
| inputs=[text_1], | |
| outputs=[text_2] | |
| ) | |
| demo.launch() |