gradio-request / app.py
cbensimon's picture
cbensimon HF Staff
Update app.py
8be6251
raw
history blame contribute delete
264 Bytes
import gradio as gr
from gradio.context import LocalContext
def greet(name):
request = LocalContext.request.get()
print(f"{request.headers=}")
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()