yeq6x commited on
Commit
a06af6c
1 Parent(s): eb467c4
Files changed (1) hide show
  1. scripts/generate_prompt.py +14 -0
scripts/generate_prompt.py CHANGED
@@ -7,6 +7,20 @@ from huggingface_hub import hf_hub_download
7
 
8
  import spaces
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # 鐢诲儚銈点偆銈恒伄瑷畾
11
  IMAGE_SIZE = 448
12
 
 
7
 
8
  import spaces
9
 
10
+ import tensorflow as tf
11
+
12
+ gpus = tf.config.list_physical_devices('GPU')
13
+ if gpus:
14
+ try:
15
+ for gpu in gpus:
16
+ tf.config.experimental.set_memory_growth(gpu, True)
17
+ print("GPUs are available and memory growth is set.")
18
+ except RuntimeError as e:
19
+ print("Error setting GPU memory growth:", e)
20
+ else:
21
+ print("No GPUs are available.")
22
+
23
+
24
  # 鐢诲儚銈点偆銈恒伄瑷畾
25
  IMAGE_SIZE = 448
26