def predict_ce(query, texts, model=None, key='ce'):
    """ 
    score all the queries with respect to the texts
    """

    if model is None:
        if key not in model_cache:
            model, tokenizer = load_ce()
            model_cache[key] = (model, tokenizer) 
        else:
            (model, tokenizer) = model_cache[key]

    # create pairs
    softmax = torch.nn.Softmax(dim=0)
    N = len(texts)
    queries = [query]*N
    pairs = list(zip(queries, texts))
    features = tokenizer(pairs,  padding=True, truncation=True, return_tensors="pt")
    
    model.eval()
    with torch.no_grad():
        scores = model(**features).logits

    return softmax(scores)
 
    score all the queries with respect to the texts
    
examples/GPT-examples/utilities.py