AwesomeK commited on
Commit
b0f3c83
1 Parent(s): 326850a

Request debug

Browse files
Files changed (1) hide show
  1. app.py +9 -0
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()