def METHOD_NAME(self, prompt: str, max_generated_tokens=100, top_k=50, top_p=0.7, temperature=1):
    input_ids, prefix_mask, past_key_values = self.prepare_input(prompt)
    output_tokens = []
    while True:
        inputs = {
            "input_ids": input_ids,
            "prefix_mask": prefix_mask,
            "use_past": np.array(len(output_tokens) > 0),
        }
        inputs.update(past_key_values)
        logits, *past_key_values = self.session.run(output_names, inputs)
        past_key_values = { k: v for k, v in zip(past_names, past_key_values) }
        next_token = self.sample_next_token(logits[0, -1], top_k=top_k, top_p=top_p, temperature=temperature)
        output_tokens += [next_token]
        if next_token == self.eop_token_id or len(output_tokens) > max_generated_tokens:
            break
        input_ids = np.array([[next_token]], dtype=np.longlong)
        prefix_mask = np.concatenate([prefix_mask, np.array([[0]], dtype=np.longlong)], axis=1)
        yield process_response(self.tokenizer.decode(output_tokens))
    return process_response(self.tokenizer.decode(output_tokens))