mirror of https://github.com/THUDM/ChatGLM-6B
Update main.py
多平台彻底解决 Default process group has not been initialized, please make sure to call init_process_group 问题。 issue里面有多个这个问题了。pull/1288/head
parent
5d3f823bcc
commit
363fd5ac4f
|
@ -48,6 +48,11 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
torch.distributed.init_process_group(backend='gloo')
|
||||||
|
else:
|
||||||
|
torch.distributed.init_process_group(backend='nccl')
|
||||||
|
|
||||||
parser = HfArgumentParser((ModelArguments, DataTrainingArguments, Seq2SeqTrainingArguments))
|
parser = HfArgumentParser((ModelArguments, DataTrainingArguments, Seq2SeqTrainingArguments))
|
||||||
if len(sys.argv) == 2 and sys.argv[1].endswith(".json"):
|
if len(sys.argv) == 2 and sys.argv[1].endswith(".json"):
|
||||||
# If we pass only one argument to the script and it's the path to a json file,
|
# If we pass only one argument to the script and it's the path to a json file,
|
||||||
|
|
Loading…
Reference in New Issue