aiqtech commited on
Commit
27c7428
·
verified ·
1 Parent(s): 2984fcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -103,10 +103,7 @@ os.environ['PYTORCH_NO_CUDA_MEMORY_CACHING'] = '1'
103
  # CUDA 초기화 방지
104
  torch.set_grad_enabled(False)
105
 
106
- def periodic_cleanup():
107
- """주기적으로 실행될 메모리 정리 함수"""
108
- clear_gpu_memory()
109
- return None
110
 
111
  # Gradio 인터페이스에 주기적 정리 추가
112
  demo.load(periodic_cleanup, every=5) # 5초마다 정리
@@ -418,6 +415,10 @@ footer {
418
  }
419
  """
420
 
 
 
 
 
421
 
422
  with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
423
  gr.Markdown("""## Craft3D""")
@@ -611,6 +612,9 @@ if __name__ == "__main__":
611
  print("Warning: trellis_pipeline is None")
612
  except Exception as e:
613
  print(f"Warning: Initial preprocessing test failed: {e}")
 
 
 
614
 
615
  # Gradio 인터페이스 실행
616
  demo.queue() # 큐 기능 활성화
 
103
  # CUDA 초기화 방지
104
  torch.set_grad_enabled(False)
105
 
106
+
 
 
 
107
 
108
  # Gradio 인터페이스에 주기적 정리 추가
109
  demo.load(periodic_cleanup, every=5) # 5초마다 정리
 
415
  }
416
  """
417
 
418
+ def periodic_cleanup():
419
+ """주기적으로 실행될 메모리 정리 함수"""
420
+ clear_gpu_memory()
421
+ return None
422
 
423
  with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
424
  gr.Markdown("""## Craft3D""")
 
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() # 큐 기능 활성화