def generate_candidates(self, context_tokens_ids, condition_ids, output_seq_len):
        """
        Predict answers for every sequence token by token until EOS_TOKEN occurred in the sequence
        using sampling with temperature.
        During the sampling procedure offensive and <unk> tokens are banned.
        Probabilities of tokens that have already been used in a response are penalized
        (divided by REPETITION_PENALIZE_COEFFICIENT).
        All the rest of the sequence is filled with PAD_TOKENs.
        """
        thought_vectors = get_thought_vectors(self._nn_model, context_tokens_ids)
        sampled_candidates = [
            self._sample_response(thought_vectors, condition_ids, output_seq_len) for _ in range(self._samples_num)
        ]

        # Transpose the result: candidate_id x batch_size x seq_len -> batch_size x candidate_id x seq_len
        return np.swapaxes(sampled_candidates, 0, 1)

        Predict answers for every sequence token by token until EOS_TOKEN occurred in the sequence
        using sampling with temperature.
        During the sampling procedure offensive and <unk> tokens are banned.
        Probabilities of tokens that have already been used in a response are penalized
        (divided by REPETITION_PENALIZE_COEFFICIENT).
        All the rest of the sequence is filled with PAD_TOKENs.
        
cakechat/dialog_model/inference/candidates/sampling.py