Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -11,11 +11,14 @@ import gradio as gr
|
|
11 |
import torch
|
12 |
from diffusers import FluxPipeline
|
13 |
from PIL import Image
|
|
|
|
|
|
|
14 |
|
15 |
# Setup and initialization code
|
16 |
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
17 |
# Change gallery path to user's home directory for persistence
|
18 |
-
gallery_path = path.join(os.
|
19 |
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
20 |
os.environ["HF_HUB_CACHE"] = cache_path
|
21 |
os.environ["HF_HOME"] = cache_path
|
@@ -358,4 +361,4 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
358 |
)
|
359 |
|
360 |
if __name__ == "__main__":
|
361 |
-
demo.launch()
|
|
|
11 |
import torch
|
12 |
from diffusers import FluxPipeline
|
13 |
from PIL import Image
|
14 |
+
# Setup and initialization code
|
15 |
+
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
16 |
+
# ์ด ๋ถ๋ถ์ ์์
|
17 |
|
18 |
# Setup and initialization code
|
19 |
cache_path = path.join(path.dirname(path.abspath(__file__)), "models")
|
20 |
# Change gallery path to user's home directory for persistence
|
21 |
+
gallery_path = path.join(os.getcwd(), "gallery") # ํ์ฌ ์์
๋๋ ํ ๋ฆฌ ๋ด์ gallery ํด๋๋ก ๋ณ๊ฒฝ
|
22 |
os.environ["TRANSFORMERS_CACHE"] = cache_path
|
23 |
os.environ["HF_HUB_CACHE"] = cache_path
|
24 |
os.environ["HF_HOME"] = cache_path
|
|
|
361 |
)
|
362 |
|
363 |
if __name__ == "__main__":
|
364 |
+
demo.launch(allowed_paths=[gallery_path]) # allowed_paths ํ๋ผ๋ฏธํฐ ์ถ๊ฐ
|