mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-06 07:03:37 +00:00
API: Move OpenAI-compatible API from extensions/openai to modules/api
This commit is contained in:
parent
2e4232e02b
commit
bf6fbc019d
23 changed files with 51 additions and 65 deletions
9
modules/api/logits.py
Normal file
9
modules/api/logits.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from .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)
|
||||
return get_next_logits(body['prompt'], state, use_samplers, "", top_logits=body['top_logits'], return_dict=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue