Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -298,6 +298,10 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
|
|
298 |
clear_gpu_memory()
|
299 |
return None, None
|
300 |
|
|
|
|
|
|
|
|
|
301 |
def clear_gpu_memory():
|
302 |
"""GPU ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ ์ฒ ์ ํ๊ฒ ์ ๋ฆฌํ๋ ํจ์"""
|
303 |
try:
|
@@ -409,6 +413,10 @@ def text_to_image(prompt: str, height: int, width: int, steps: int, scales: floa
|
|
409 |
torch.cuda.synchronize()
|
410 |
gc.collect()
|
411 |
|
|
|
|
|
|
|
|
|
412 |
css = """
|
413 |
footer {
|
414 |
visibility: hidden;
|
@@ -612,9 +620,6 @@ if __name__ == "__main__":
|
|
612 |
print("Warning: trellis_pipeline is None")
|
613 |
except Exception as e:
|
614 |
print(f"Warning: Initial preprocessing test failed: {e}")
|
615 |
-
|
616 |
-
# ์ฃผ๊ธฐ์ ์ ๋ฆฌ ์ค์
|
617 |
-
demo.load(periodic_cleanup, every=5) # 5์ด๋ง๋ค ์ ๋ฆฌ
|
618 |
|
619 |
# Gradio ์ธํฐํ์ด์ค ์คํ
|
620 |
demo.queue() # ํ ๊ธฐ๋ฅ ํ์ฑํ
|
|
|
298 |
clear_gpu_memory()
|
299 |
return None, None
|
300 |
|
301 |
+
return generated_image
|
302 |
+
finally:
|
303 |
+
clear_gpu_memory() # ํจ์ ์ข
๋ฃ ์ ๋ฉ๋ชจ๋ฆฌ ์ ๋ฆฌ
|
304 |
+
|
305 |
def clear_gpu_memory():
|
306 |
"""GPU ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ ์ฒ ์ ํ๊ฒ ์ ๋ฆฌํ๋ ํจ์"""
|
307 |
try:
|
|
|
413 |
torch.cuda.synchronize()
|
414 |
gc.collect()
|
415 |
|
416 |
+
return generated_image
|
417 |
+
finally:
|
418 |
+
clear_gpu_memory() # ํจ์ ์ข
๋ฃ ์ ๋ฉ๋ชจ๋ฆฌ ์ ๋ฆฌ
|
419 |
+
|
420 |
css = """
|
421 |
footer {
|
422 |
visibility: hidden;
|
|
|
620 |
print("Warning: trellis_pipeline is None")
|
621 |
except Exception as e:
|
622 |
print(f"Warning: Initial preprocessing test failed: {e}")
|
|
|
|
|
|
|
623 |
|
624 |
# Gradio ์ธํฐํ์ด์ค ์คํ
|
625 |
demo.queue() # ํ ๊ธฐ๋ฅ ํ์ฑํ
|