Skip to content

Commit

Permalink
refactor: fix code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tridu33 committed Dec 24, 2024
1 parent 686f322 commit b653af6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ echo "start training"

export MULTI_NPU="true"
export ASCEND_SLOG_PRINT_TO_STDOUT=1
export ASCEND_RT_VISIBLE_DEVICES=6,7 # Specify the available card numbers

msrun --worker_num=2 --local_worker_num=2 --master_port=8121 \
--log_dir=bert_imdb_finetune_cpu_mindnlp_trainer_npus_same --join=True \
Expand Down
6 changes: 2 additions & 4 deletions mindnlp/utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ def threads_exclusive_http_get(url, storage_folder=None, md5sum=None, download_f
pointer_path = os.path.join(storage_folder, download_file_name)
lock_file_path = pointer_path + ".lock"
if sys.platform != "win32":
# pylint: disable=import-error
import fcntl
import fcntl # pylint: disable=import-error
else:
# pylint: disable=import-error
import winfcntlock as fcntl
import winfcntlock as fcntl # pylint: disable=import-error
with open(lock_file_path, 'w') as lock_file:
fd = lock_file.fileno()
try:
Expand Down
9 changes: 3 additions & 6 deletions mindnlp/utils/winfcntlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
# limitations under the License.
# ============================================================================
"""fcntl replacement for Windows."""
# pylint: disable=import-error
import win32con
# pylint: disable=import-error
import pywintypes
# pylint: disable=import-error
import win32file
import win32con # pylint: disable=import-error
import pywintypes # pylint: disable=import-error
import win32file # pylint: disable=import-error


LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
Expand Down

0 comments on commit b653af6

Please sign in to comment.