def run_embeddings_text(encoder, decoder, tokenizer, prompt, max_context_length=512):
    """ Utility function to get the embeddings of a given text prompt
    Args:
        encoder: inference session to use for the encoder
        decoder: inference session to use for the decoder
        tokenizer: huggingface tokenizer to tokenize the inputs
        prompt: str to run
        max_context_length: maximum number of tokens to use as context

    """
    input_ids = tokenizer.encode(prompt, return_tensors='pt').numpy()[:max_context_length]

    # To generate the encoder's last hidden state
    encoder_output = encoder.run(None, {"input_ids": input_ids})[0]
    # To generate the full model's embeddings
    decoder_output = decoder.run(None, {
        "input_ids": input_ids,
        "encoder_hidden_states": encoder_output
    })[0]

    return encoder_output, decoder_output