Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,15 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
# Ganti URL model dengan URL model Anda di Hugging Face Spaces
|
4 |
url = "spaces/Adityadn/AI-Image"
|
5 |
|
|
|
|
|
|
|
6 |
# Buat antarmuka Gradio
|
7 |
-
iface = gr.load(url, hf_token=
|
8 |
|
9 |
# Jalankan antarmuka di localhost atau sesuaikan dengan kebutuhan Anda
|
10 |
iface.launch()
|
|
|
1 |
+
import subprocess
|
2 |
+
import os
|
3 |
import gradio as gr
|
4 |
|
5 |
# Ganti URL model dengan URL model Anda di Hugging Face Spaces
|
6 |
url = "spaces/Adityadn/AI-Image"
|
7 |
|
8 |
+
# Dapatkan token akses Hugging Face dari variabel lingkungan
|
9 |
+
token = os.environ.get("AI_Image")
|
10 |
+
|
11 |
# Buat antarmuka Gradio
|
12 |
+
iface = gr.load(url, hf_token=token)
|
13 |
|
14 |
# Jalankan antarmuka di localhost atau sesuaikan dengan kebutuhan Anda
|
15 |
iface.launch()
|