From 4cd79db451786548d8a100f25c3b03da0eb30f4b Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 16 五月 2023 14:08:57 +0800
Subject: [PATCH] inference
---
funasr/bin/asr_train.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/funasr/bin/asr_train.py b/funasr/bin/asr_train.py
index bba50da..0dec107 100755
--- a/funasr/bin/asr_train.py
+++ b/funasr/bin/asr_train.py
@@ -1,4 +1,7 @@
+# -*- encoding: utf-8 -*-
#!/usr/bin/env python3
+# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
+# MIT License (https://opensource.org/licenses/MIT)
import os
@@ -27,7 +30,8 @@
args = parse_args()
# setup local gpu_id
- os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_id)
+ if args.ngpu > 0:
+ os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_id)
# DDP settings
if args.ngpu > 1:
@@ -38,9 +42,9 @@
# re-compute batch size: when dataset type is small
if args.dataset_type == "small":
- if args.batch_size is not None:
+ if args.batch_size is not None and args.ngpu > 0:
args.batch_size = args.batch_size * args.ngpu
- if args.batch_bins is not None:
+ if args.batch_bins is not None and args.ngpu > 0:
args.batch_bins = args.batch_bins * args.ngpu
main(args=args)
--
Gitblit v1.9.1