mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 13:02:38 +00:00
completion() for tgi
This commit is contained in:
parent
21f2e9adf5
commit
5570a63248
4 changed files with 100 additions and 8 deletions
|
|
@ -31,6 +31,13 @@ def completion_request_to_prompt(
|
|||
return formatter.tokenizer.decode(model_input.tokens)
|
||||
|
||||
|
||||
def completion_request_to_prompt_model_input_info(
|
||||
request: CompletionRequest, formatter: ChatFormat
|
||||
) -> Tuple[str, int]:
|
||||
model_input = formatter.encode_content(request.content)
|
||||
return (formatter.tokenizer.decode(model_input.tokens), len(model_input.tokens))
|
||||
|
||||
|
||||
def chat_completion_request_to_prompt(
|
||||
request: ChatCompletionRequest, formatter: ChatFormat
|
||||
) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue