paddlenlp/taskflow/text_generation.py
def _run_model(self, inputs):
        """
        Run the task model from the outputs of the `_tokenize` function. 
        """
        results = []
        lens = []
        with static_mode_guard():
            for batch in inputs['data_loader']:
                ids, seq_len = self._batchify_fn(batch)
                self.input_handles[0].copy_from_cpu(ids)
                self.predictor.run()
                result = self.output_handle[0].copy_to_cpu().tolist()
                results.extend(result)
                lens.extend(seq_len.tolist())
        inputs['results'] = results
        inputs['lens'] = lens
        return inputs

        Run the task model from the outputs of the `_tokenize` function. 
        
Run the task model from the outputs of the `_tokenize` function.
Run the task model from the outputs of the ` _tokenize ` function .
def _run_model(self, inputs):
        results = []
        lens = []
        with static_mode_guard():
            for batch in inputs['data_loader']:
                ids, seq_len = self._batchify_fn(batch)
                self.input_handles[0].copy_from_cpu(ids)
                self.predictor.run()
                result = self.output_handle[0].copy_to_cpu().tolist()
                results.extend(result)
                lens.extend(seq_len.tolist())
        inputs['results'] = results
        inputs['lens'] = lens
        return inputs
def _run_model ( self , inputs ) : results = [ ] lens = [ ] with static_mode_guard ( ) : for batch in inputs [ 'data_loader' ] : ids , seq_len = self . _batchify_fn ( batch ) self . input_handles [ 0 ] . copy_from_cpu ( ids ) self . predictor . run ( ) result = self . output_handle [ 0 ] . copy_to_cpu ( ) . tolist ( ) results . extend ( result ) lens . extend ( seq_len . tolist ( ) ) inputs [ 'results' ] = results inputs [ 'lens' ] = lens return inputs
Run the task model from the outputs of the `_tokenize` function.
Run the task model from the outputs of the ` _tokenize ` function .
"""
        Run the task model from the outputs of the `_tokenize` function. 
        """
self
inputs