fantos commited on
Commit
37571b8
ยท
verified ยท
1 Parent(s): 0b34ea3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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.path.expanduser("~"), "ai_generated_images")
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 ํŒŒ๋ผ๋ฏธํ„ฐ ์ถ”๊ฐ€