Request debug
Browse files
app.py
CHANGED
@@ -19,3 +19,12 @@ def greet(name):
|
|
19 |
|
20 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
21 |
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
21 |
iface.launch()
|
22 |
+
|
23 |
+
def echo(text, request: gr.Request):
|
24 |
+
if request:
|
25 |
+
print("Request headers dictionary:", request.headers)
|
26 |
+
print("IP address:", request.client.host)
|
27 |
+
print("Query parameters:", dict(request.query_params))
|
28 |
+
return text
|
29 |
+
|
30 |
+
xio = gr.Interface(echo, "textbox", "textbox").launch()
|