Spaces:
Running
on
L40S
Running
on
L40S
Update app.py
Browse files
app.py
CHANGED
@@ -318,13 +318,14 @@ if __name__ == "__main__":
|
|
318 |
"JeffreyXiang/TRELLIS-image-large",
|
319 |
use_auth_token=HF_TOKEN
|
320 |
)
|
321 |
-
pipeline.cuda()
|
322 |
|
323 |
# ์ด๋ฏธ์ง ์์ฑ ํ์ดํ๋ผ์ธ
|
324 |
pipe = FluxPipeline.from_pretrained(
|
325 |
"black-forest-labs/FLUX.1-dev",
|
326 |
torch_dtype=torch.bfloat16,
|
327 |
-
use_auth_token=HF_TOKEN
|
|
|
328 |
)
|
329 |
|
330 |
# Hyper-SD LoRA ๋ก๋
|
@@ -336,7 +337,11 @@ if __name__ == "__main__":
|
|
336 |
)
|
337 |
)
|
338 |
pipe.fuse_lora(lora_scale=0.125)
|
339 |
-
|
|
|
|
|
|
|
|
|
340 |
|
341 |
try:
|
342 |
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8)))
|
|
|
318 |
"JeffreyXiang/TRELLIS-image-large",
|
319 |
use_auth_token=HF_TOKEN
|
320 |
)
|
321 |
+
pipeline.to("cuda") # .cuda() ๋์ .to("cuda") ์ฌ์ฉ
|
322 |
|
323 |
# ์ด๋ฏธ์ง ์์ฑ ํ์ดํ๋ผ์ธ
|
324 |
pipe = FluxPipeline.from_pretrained(
|
325 |
"black-forest-labs/FLUX.1-dev",
|
326 |
torch_dtype=torch.bfloat16,
|
327 |
+
use_auth_token=HF_TOKEN,
|
328 |
+
device_map="auto" # device_map ์ถ๊ฐ
|
329 |
)
|
330 |
|
331 |
# Hyper-SD LoRA ๋ก๋
|
|
|
337 |
)
|
338 |
)
|
339 |
pipe.fuse_lora(lora_scale=0.125)
|
340 |
+
|
341 |
+
# ๋ฒ์ญ๊ธฐ ์ด๊ธฐํ (GPU ์ค์ ์ถ๊ฐ)
|
342 |
+
translator = pipeline("translation",
|
343 |
+
model="Helsinki-NLP/opus-mt-ko-en",
|
344 |
+
device=0 if torch.cuda.is_available() else -1)
|
345 |
|
346 |
try:
|
347 |
pipeline.preprocess_image(Image.fromarray(np.zeros((512, 512, 3), dtype=np.uint8)))
|