jclyo1 commited on
Commit
0e016e5
1 Parent(s): 6899a0b

updates to empty cache

Browse files
Files changed (1) hide show
  1. main.py +2 -0
main.py CHANGED
@@ -20,6 +20,8 @@ app = FastAPI()
20
 
21
  @app.get("/generate")
22
  def generate_image(prompt, inference_steps, model):
 
 
23
  print(f"Is CUDA available: {torch.cuda.is_available()}")
24
 
25
  #model_id = "CompVis/stable-diffusion-v1-4" #stabilityai/stable-diffusion-2-1
 
20
 
21
  @app.get("/generate")
22
  def generate_image(prompt, inference_steps, model):
23
+ torch.cuda.empty_cache()
24
+
25
  print(f"Is CUDA available: {torch.cuda.is_available()}")
26
 
27
  #model_id = "CompVis/stable-diffusion-v1-4" #stabilityai/stable-diffusion-2-1