| import gradio as gr | |
| import requests | |
| def fucntion(prompt): | |
| response = requests.post("https://tommy24-testing45.hf.space/run/predict", json={ | |
| "data": [ | |
| prompt, | |
| ] | |
| }).json() | |
| data = response["data"][0]["name"] | |
| data = "https://tommy24-testing45.hf.space/file=" + data | |
| return data | |
| iface = gr.Interface(fn=fucntion, inputs="text", outputs="text") | |
| iface.launch() |