@contextmanager<EOL><INDENT>def use_params(self, params, **cfg):<DEDENT>
contexts = [<EOL>pipe.use_params(params)<EOL>for name, pipe in self.pipeline<EOL>if hasattr(pipe, "<STR_LIT>")<EOL>]<EOL>for context in contexts:<EOL><INDENT>try:<EOL><INDENT>next(context)<EOL><DEDENT>except StopIteration:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>yield<EOL>for context in contexts:<EOL><INDENT>try:<EOL><INDENT>next(context)<EOL><DEDENT>except StopIteration:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Replace weights of models in the pipeline with those provided in the
        params dictionary. Can be used as a contextmanager, in which case,
        models go back to their original weights after the block.

        params (dict): A dictionary of parameters keyed by model ID.
        **cfg: Config parameters.

        EXAMPLE:
            >>> with nlp.use_params(optimizer.averages):
            >>>     nlp.to_disk('/tmp/checkpoint')