libokj commited on
Commit
e519538
·
verified ·
1 Parent(s): d281b4d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def predict(text, request: gr.Request):
4
+ return {
5
+ "ip": request.client.host,
6
+ "user_agent": request.headers["user-agent"]
7
+ }
8
+
9
+ demo = gr.Interface(fn=predict, inputs="text", outputs="json")
10
+ demo.launch()