Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def fucntion(prompt):
|
| 4 |
+
response = requests.post("https://tommy24-testing45.hf.space/run/predict", json={
|
| 5 |
+
"data": [
|
| 6 |
+
prompt,
|
| 7 |
+
]
|
| 8 |
+
}).json()
|
| 9 |
+
|
| 10 |
+
data = response["data"][0]["name"]
|
| 11 |
+
data = "https://tommy24-testing45.hf.space/file=" + data
|
| 12 |
+
return data
|
| 13 |
+
|
| 14 |
+
iface = gr.Interface(fn=fucntion, inputs="text", outputs="text")
|
| 15 |
+
iface.launch()
|