Download app.py from Shima111/test2: direct link, hf CLI and curl.
- Browser
- Download file 481 Bytes
-
https://huggingface.co/spaces/Shima111/test2/resolve/main/app.py
- Command line
-
hf download hf://spaces/Shima111/test2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Shima111/test2/resolve/main/app.py
481 Bytes
| import gradio as gr | |
| import requests | |
| import json | |
| def greet(name): | |
| url = "https://us-central1-hugging1-india.cloudfunctions.net/test/image" | |
| payload = {"image": name} | |
| headers = {"Content-Type": "application/json"} | |
| response = requests.post(url, data=json.dumps(payload), headers=headers) | |
| print(response) | |
| return "Hello " + name + "!!" | |
| iface = gr.Interface(fn=greet, inputs=["text"], outputs="text") | |
| iface.launch() |