MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / write_args

Function write_args

inspiremusic/utils/tokenizer_utils.py:79–91  ·  view source on GitHub ↗
(args, path)

Source from the content-addressed store, hash-verified

77
78
79def write_args(args, path):
80 args_dict = dict((name, getattr(args, name)) for name in dir(args)
81 if not name.startswith('_'))
82 with open(path, 'a') as args_file:
83 args_file.write('==> torch version: {}\n'.format(torch.__version__))
84 args_file.write(
85 '==> cudnn version: {}\n'.format(torch.backends.cudnn.version()))
86 args_file.write('==> Cmd:\n')
87 args_file.write(str(sys.argv))
88 args_file.write('\n==> args:\n')
89 for k, v in sorted(args_dict.items()):
90 args_file.write(' %s: %s\n' % (str(k), str(v)))
91 args_file.close()
92
93
94class Logger(object):

Callers 1

__init__Method · 0.85

Calls 1

closeMethod · 0.80

Tested by

no test coverage detected