lele-cecere commited on
Commit
26afdde
1 Parent(s): 1767210

changed dependencies

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -2
  2. main.py +9 -10
Dockerfile CHANGED
@@ -13,8 +13,6 @@ RUN pip install --no-cache-dir torch torchvision
13
  COPY gpu_check.py /code/gpu_check.py
14
  RUN python /code/gpu_check.py
15
 
16
- RUN nvcc -V
17
-
18
  # Set up a new user named "user" with user ID 1000
19
  RUN useradd -m -u 1000 user
20
 
 
13
  COPY gpu_check.py /code/gpu_check.py
14
  RUN python /code/gpu_check.py
15
 
 
 
16
  # Set up a new user named "user" with user ID 1000
17
  RUN useradd -m -u 1000 user
18
 
main.py CHANGED
@@ -37,6 +37,15 @@ print(pynvml.nvmlSystemGetCudaDriverVersion())
37
  cuda_version = torch.version.cuda
38
  print("PyTorch is using CUDA Version:", cuda_version)
39
 
 
 
 
 
 
 
 
 
 
40
 
41
  def print_gpu_utilization():
42
  nvmlInit()
@@ -196,16 +205,6 @@ def initModel(model_name_or_path, revision):
196
  return generator
197
 
198
 
199
- # Check if CUDA is available
200
- if torch.cuda.is_available():
201
- print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
202
- device = torch.device("cuda")
203
- else:
204
- print("CUDA is not available. Using CPU.")
205
-
206
- torch.zeros(1).cuda()
207
-
208
-
209
  def generateTags():
210
  start = time.time()
211
  res = generateMods(generator, bag_metadata, dress_example, bomber_example)
 
37
  cuda_version = torch.version.cuda
38
  print("PyTorch is using CUDA Version:", cuda_version)
39
 
40
+ # Check if CUDA is available
41
+ if torch.cuda.is_available():
42
+ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
43
+ device = torch.device("cuda")
44
+ else:
45
+ print("CUDA is not available. Using CPU.")
46
+
47
+ torch.zeros(1).cuda()
48
+
49
 
50
  def print_gpu_utilization():
51
  nvmlInit()
 
205
  return generator
206
 
207
 
 
 
 
 
 
 
 
 
 
 
208
  def generateTags():
209
  start = time.time()
210
  res = generateMods(generator, bag_metadata, dress_example, bomber_example)