Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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="
|
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
|