File size: 446 Bytes
60be607
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from extensions.openai.completions import process_parameters
from modules.logits import get_next_logits


def _get_next_logits(body):
    # Pre-process the input payload to simulate a real generation
    use_samplers = body['use_samplers']
    state = process_parameters(body) if use_samplers else {}
    state['stream'] = True

    return get_next_logits(body['prompt'], state, use_samplers, "", top_logits=body['top_logits'], return_dict=True)