Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@runway.setup(options={ "configuration": any() })
def setup(opts):
config = yaml.load(opts["configuration"])
print(config)
# return model(config)
@runway.setup(options={'model_size': category(choices=['big', 'little'])})
def setup(opts):
if opts['model_size'] == 'big':
return big_model()
else:
return little_model()
@runway.setup(options=setup_options)
def setup(opts):
msg = '[SETUP] Ran with options: seed = {}, truncation = {}'
print(msg.format(opts['seed'], opts['truncation']))
model = ExampleModel(opts)
return model
@runway.setup(options={'truncation': 'float', 'seed': 'integer'})
def setup(opts):
model = init_model(opts)
return model
@runway.setup(options={ "seed_sentences": array(item_type=text, min_length=5) })
def setup(opts):
for i in range(5):
print("Sentence {} is \"{}\"".format(i+1, opts["seed_sentences"][i]))
@runway.setup(options={ "flavor": text(default="vanilla") })
def setup(opts):
print("The selected flavor is {}".format(opts["flavor"]))
@runway.setup(options={'suffix': text})
def setup(options):
return options['suffix']
@runway.setup(options=options)
def setup(opts):
print("Setup ran, and the network size is {}".format(opts["network_size"]))
return model(network_size=opts["network_size"])