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:
Aaron Pham
2023-11-07 16:42:20 -05:00
committed by GitHub
parent 8fade070f3
commit dc27b0e727
5 changed files with 21 additions and 22 deletions

View File

@@ -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'
'''

View File

@@ -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: