Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import requests
|
|
|
2 |
|
3 |
def get_waifu_image():
|
4 |
try:
|
@@ -9,6 +10,15 @@ def get_waifu_image():
|
|
9 |
except Exception as e:
|
10 |
return {"error": str(e)}
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import requests
|
2 |
+
import gradio as gr
|
3 |
|
4 |
def get_waifu_image():
|
5 |
try:
|
|
|
10 |
except Exception as e:
|
11 |
return {"error": str(e)}
|
12 |
|
13 |
+
# Membuat interface Gradio
|
14 |
+
iface = gr.Interface(
|
15 |
+
fn=get_waifu_image,
|
16 |
+
inputs=[],
|
17 |
+
outputs="json", # Mengatur output ke format JSON
|
18 |
+
title="Waifu Image Fetcher",
|
19 |
+
description="Mengambil gambar Waifu dan menampilkan URL dalam format JSON."
|
20 |
+
)
|
21 |
+
|
22 |
+
# Menjalankan aplikasi
|
23 |
+
if __name__ == "__main__":
|
24 |
+
iface.launch()
|