Formatting
This commit is contained in:
parent
0daf16defc
commit
4f5f99ef2a
1 changed files with 7 additions and 3 deletions
|
@ -109,7 +109,9 @@ CreateCompletionResponse = create_model_from_typeddict(llama_cpp.Completion)
|
||||||
"/v1/completions",
|
"/v1/completions",
|
||||||
response_model=CreateCompletionResponse,
|
response_model=CreateCompletionResponse,
|
||||||
)
|
)
|
||||||
def create_completion(request: CreateCompletionRequest, llama: llama_cpp.Llama=Depends(get_llama)):
|
def create_completion(
|
||||||
|
request: CreateCompletionRequest, llama: llama_cpp.Llama = Depends(get_llama)
|
||||||
|
):
|
||||||
if isinstance(request.prompt, list):
|
if isinstance(request.prompt, list):
|
||||||
request.prompt = "".join(request.prompt)
|
request.prompt = "".join(request.prompt)
|
||||||
|
|
||||||
|
@ -153,7 +155,9 @@ CreateEmbeddingResponse = create_model_from_typeddict(llama_cpp.Embedding)
|
||||||
"/v1/embeddings",
|
"/v1/embeddings",
|
||||||
response_model=CreateEmbeddingResponse,
|
response_model=CreateEmbeddingResponse,
|
||||||
)
|
)
|
||||||
def create_embedding(request: CreateEmbeddingRequest, llama: llama_cpp.Llama=Depends(get_llama)):
|
def create_embedding(
|
||||||
|
request: CreateEmbeddingRequest, llama: llama_cpp.Llama = Depends(get_llama)
|
||||||
|
):
|
||||||
return llama.create_embedding(**request.dict(exclude={"model", "user"}))
|
return llama.create_embedding(**request.dict(exclude={"model", "user"}))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue