Spaces:
Build error
Build error
Download app.py from leftattention/sample_api_for_t2v: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/spaces/leftattention/sample_api_for_t2v/resolve/main/app.py
- Command line
-
hf download hf://spaces/leftattention/sample_api_for_t2v/app.py
-
curl -L -o app.py https://huggingface.co/spaces/leftattention/sample_api_for_t2v/resolve/main/app.py
509 Bytes
| import requests | |
| import gradio as gr | |
| def get_random_file_from_s3(input_txt, api_key): | |
| url = "http://18.189.132.140:5218/run/predict" | |
| response = requests.post( | |
| url=url, | |
| json={ | |
| "data": [ | |
| "abcd", | |
| "J4g7Bv9Tm0A3Q6yZ" | |
| ] | |
| } | |
| ).json() | |
| file_url = response["data"][0] | |
| return file_url | |
| gr.Interface( | |
| get_random_file_from_s3, | |
| inputs=[ | |
| "text", | |
| "text" | |
| ], | |
| outputs=["text"] | |
| ).launch() | |