jina.optimizers.flow_runner¶

class jina.optimizers.flow_runner.FlowRunner(flow_yaml, documents, request_size, task, callback=None, overwrite_workspace=False)[source]¶

Bases: object

Module to define and run a flow.

Parameters
  • flow_yaml – path to flow yaml

  • documents – iterator with list or generator for getting the documents

  • request_size – request size used in the flow

  • task – task of the flow which can be index or search

  • callback – callback to be passed to the flow’s on_done

  • overwrite_workspace – overwrite workspace created by the flow

run(trial_parameters, workspace='workspace', **kwargs)[source]¶

[summary]

Parameters
  • trial_parameters (dict) – flow env variable values

  • workspace (str) – directory to be used for artifacts generated

class jina.optimizers.flow_runner.MultiFlowRunner(*flows)[source]¶

Bases: object

Chain and run multiple flows

Parameters

flows – flows to be executed in sequence

run(trial_parameters, workspace='workspace', **kwargs)[source]¶
Parameters
  • trial_parameters (dict) – parameters to be used as environment variables

  • workspace (str) – directory to be used for the flows