How to use the runway.setup function in runway

To help you get started, we’ve selected a few runway examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github runwayml / model-sdk / examples / docs_code_snippets / data_types_any.py View on Github external
@runway.setup(options={ "configuration": any() })
def setup(opts):
    config = yaml.load(opts["configuration"])
    print(config)
    # return model(config)
github runwayml / model-sdk / examples / docs_code_snippets / index_example.py View on Github external
@runway.setup(options={'model_size': category(choices=['big', 'little'])})
def setup(opts):
    if opts['model_size'] == 'big':
        return big_model()
    else:
        return little_model()
github runwayml / model-template / runway_model.py View on Github external
@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
github runwayml / model-template / model.py View on Github external
@runway.setup(options={'truncation': 'float', 'seed': 'integer'})
def setup(opts):
    model = init_model(opts)
    return model
github runwayml / model-sdk / examples / docs_code_snippets / data_types_array.py View on Github external
@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]))
github runwayml / model-sdk / examples / docs_code_snippets / data_types_text.py View on Github external
@runway.setup(options={ "flavor": text(default="vanilla") })
def setup(opts):
    print("The selected flavor is {}".format(opts["flavor"]))
github runwayml / model-sdk / examples / example_server.py View on Github external
@runway.setup(options={'suffix': text})
def setup(options):
    return options['suffix']
github runwayml / model-sdk / examples / docs_code_snippets / runway_module_setup.py View on Github external
@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"])