Skip to content

Commit 51170b2

Browse files
chore(format): run black on dev (#125)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 0333064 commit 51170b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

configs/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ def use_insecure_load():
137137
logging.warning("Using insecure weight loading for fairseq dictionary")
138138
except AttributeError:
139139
pass
140-
140+
141141
@staticmethod
142142
def get_default_batch_size() -> int:
143143
if not torch.cuda.is_available():
144-
#TODO: add non-cuda multicards
144+
# TODO: add non-cuda multicards
145145
return 1
146146
# 判断是否有能用来训练和加速推理的N卡
147147
ngpu = torch.cuda.device_count()
@@ -155,7 +155,10 @@ def get_default_batch_size() -> int:
155155
mem.append(
156156
int(
157157
torch.cuda.get_device_properties(i).total_memory
158-
/ 1024 / 1024 / 1024 + 0.4
158+
/ 1024
159+
/ 1024
160+
/ 1024
161+
+ 0.4
159162
)
160163
)
161164
if if_gpu_ok:

0 commit comments

Comments
 (0)