INNER CODE UNIT · Python
new
HyperGAN/HyperGAN · hypergan/cli.py:200
def new(self):
if self.args.toml:
config_format = '.toml'
else:
config_format = '.json'
template = self.args.directory + config_format
print("[hypergan] Creating new configuration file '"+template+"' based off of '"+self.config_name+config_format)
if os.path.isfile(template):
raise ValidationException("File exists: " + template)
source_configuration = Configuration.find(self.config_name+config_format, config_format=config_format, prepackaged=True)
shutil.copyfile(source_configuration, template)
return
def run(self):
if self.method == 'train':
self.train()
elif self.method == 'build':