mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix(main.py): fix null finish reason issue for ollama
This commit is contained in:
parent
69eca78000
commit
61185aa12c
1 changed files with 1 additions and 1 deletions
|
@ -369,7 +369,6 @@ def completion(
|
||||||
model
|
model
|
||||||
] # update the model to the actual value if an alias has been passed in
|
] # update the model to the actual value if an alias has been passed in
|
||||||
model_response = ModelResponse()
|
model_response = ModelResponse()
|
||||||
|
|
||||||
if kwargs.get('azure', False) == True: # don't remove flag check, to remain backwards compatible for repos like Codium
|
if kwargs.get('azure', False) == True: # don't remove flag check, to remain backwards compatible for repos like Codium
|
||||||
custom_llm_provider="azure"
|
custom_llm_provider="azure"
|
||||||
if deployment_id != None: # azure llms
|
if deployment_id != None: # azure llms
|
||||||
|
@ -1263,6 +1262,7 @@ def completion(
|
||||||
response_string+=chunk['content']
|
response_string+=chunk['content']
|
||||||
|
|
||||||
## RESPONSE OBJECT
|
## RESPONSE OBJECT
|
||||||
|
model_response["choices"][0]["finish_reason"] = "stop"
|
||||||
model_response["choices"][0]["message"]["content"] = response_string
|
model_response["choices"][0]["message"]["content"] = response_string
|
||||||
model_response["created"] = int(time.time())
|
model_response["created"] = int(time.time())
|
||||||
model_response["model"] = "ollama/" + model
|
model_response["model"] = "ollama/" + model
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue