ginipick commited on
Commit
2a729b9
ยท
verified ยท
1 Parent(s): 3cee212

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -79,11 +79,12 @@ gd_model = GroundingDinoForObjectDetection.from_pretrained(gd_model_path, torch_
79
  gd_model = gd_model.to(device=device)
80
  assert isinstance(gd_model, GroundingDinoForObjectDetection)
81
 
 
82
  pipe = FluxPipeline.from_pretrained(
83
  "black-forest-labs/FLUX.1-dev",
84
  torch_dtype=torch.float16, # ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰ ๊ฐ์†Œ๋ฅผ ์œ„ํ•ด float16 ์‚ฌ์šฉ
85
  use_auth_token=HF_TOKEN,
86
- device_map="auto" # ์ž๋™ ์žฅ์น˜ ๋งคํ•‘
87
  )
88
  pipe.load_lora_weights(
89
  hf_hub_download(
@@ -95,6 +96,8 @@ pipe.load_lora_weights(
95
  pipe.fuse_lora(lora_scale=0.125)
96
 
97
 
 
 
98
  class timer:
99
  def __init__(self, method_name="timed process"):
100
  self.method = method_name
 
79
  gd_model = gd_model.to(device=device)
80
  assert isinstance(gd_model, GroundingDinoForObjectDetection)
81
 
82
+ # FLUX ํŒŒ์ดํ”„๋ผ์ธ ์ดˆ๊ธฐํ™” ๋ถ€๋ถ„ ์ˆ˜์ •
83
  pipe = FluxPipeline.from_pretrained(
84
  "black-forest-labs/FLUX.1-dev",
85
  torch_dtype=torch.float16, # ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰ ๊ฐ์†Œ๋ฅผ ์œ„ํ•ด float16 ์‚ฌ์šฉ
86
  use_auth_token=HF_TOKEN,
87
+ device_map="balanced" # 'auto' ๋Œ€์‹  'balanced' ์‚ฌ์šฉ
88
  )
89
  pipe.load_lora_weights(
90
  hf_hub_download(
 
96
  pipe.fuse_lora(lora_scale=0.125)
97
 
98
 
99
+
100
+
101
  class timer:
102
  def __init__(self, method_name="timed process"):
103
  self.method = method_name