KazeDevID commited on
Commit
8baf1dd
1 Parent(s): a4b3b65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
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
- # Menampilkan output langsung
13
- output = get_waifu_image()
14
- print(output)
 
 
 
 
 
 
 
 
 
 
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()