Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,8 @@ import socket
|
|
| 4 |
def predict(text, request: gr.Request):
|
| 5 |
client_ip = request.client.host
|
| 6 |
local_ip = socket.gethostbyname(socket.gethostname())
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
with gr.Blocks() as block:
|
| 10 |
gr.Markdown("## Test request")
|
|
|
|
| 4 |
def predict(text, request: gr.Request):
|
| 5 |
client_ip = request.client.host
|
| 6 |
local_ip = socket.gethostbyname(socket.gethostname())
|
| 7 |
+
headers = request.headers
|
| 8 |
+
return text, {"client_ip": client_ip, "local_ip": local_ip, "headers": headers}
|
| 9 |
|
| 10 |
with gr.Blocks() as block:
|
| 11 |
gr.Markdown("## Test request")
|