mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-05-19 14:16:22 -04:00
fix: update build dependencies and format chat prompt (#569)
chore: update correct check and format prompt Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -45,10 +45,12 @@ responses:
|
||||
content:
|
||||
application/json:
|
||||
example:
|
||||
id: davinci
|
||||
object: model
|
||||
created: 1686935002
|
||||
owned_by: openai
|
||||
object: 'list'
|
||||
data:
|
||||
- id: meta-llama--Llama-2-13-chat-hf
|
||||
object: model
|
||||
created: 1686935002
|
||||
owned_by: 'na'
|
||||
schema:
|
||||
$ref: '#/components/schemas/ModelList'
|
||||
'''
|
||||
|
||||
@@ -41,7 +41,6 @@ from ..protocol.openai import LogProbs
|
||||
from ..protocol.openai import ModelCard
|
||||
from ..protocol.openai import ModelList
|
||||
from ..protocol.openai import UsageInfo
|
||||
from ..protocol.openai import get_conversation_prompt
|
||||
|
||||
schemas = get_generator(
|
||||
'openai',
|
||||
@@ -129,7 +128,8 @@ async def create_chat_completions(req: Request, llm: openllm.LLM[M, T]) -> Respo
|
||||
|
||||
model_name, request_id = request.model, gen_random_uuid('chatcmpl')
|
||||
created_time = int(time.monotonic())
|
||||
prompt = await get_conversation_prompt(request, llm.config)
|
||||
prompt = llm.tokenizer.apply_chat_template(request.messages, tokenize=False)
|
||||
logger.debug('Prompt: %r', prompt)
|
||||
config = llm.config.with_openai_request(request)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user