MohamedRashad commited on
Commit
b1b4917
·
1 Parent(s): f4f0e5b

Add nvidia-smi command to app.py for GPU monitoring

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -10,6 +10,7 @@ os.environ['SPCONV_ALGO'] = 'native'
10
  from typing import *
11
  import torch
12
  print(torch.__version__)
 
13
  import numpy as np
14
  import imageio
15
  import uuid
@@ -23,8 +24,8 @@ from diffusers import FluxPipeline, AutoencoderKL, AutoencoderTiny
23
  from live_preview_helpers import flux_pipe_call_that_returns_an_iterable_of_images
24
 
25
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
26
- device = "cuda" if torch.cuda.is_available() else "cpu"
27
 
 
28
  taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.bfloat16).to(device)
29
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
30
  good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)
 
10
  from typing import *
11
  import torch
12
  print(torch.__version__)
13
+ os.system("nvidia-smi")
14
  import numpy as np
15
  import imageio
16
  import uuid
 
24
  from live_preview_helpers import flux_pipe_call_that_returns_an_iterable_of_images
25
 
26
  llm_client = Client("Qwen/Qwen2.5-72B-Instruct")
 
27
 
28
+ device = "cuda" if torch.cuda.is_available() else "cpu"
29
  taef1 = AutoencoderTiny.from_pretrained("madebyollin/taef1", torch_dtype=torch.bfloat16).to(device)
30
  pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to(device)
31
  good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfolder="vae", torch_dtype=torch.bfloat16).to(device)