fix replicate edge case for custom provider in model name

This commit is contained in:
Krrish Dholakia 2023-08-19 16:46:15 -07:00
parent 5e53c9664c
commit 57efebb1c4
2 changed files with 3 additions and 1 deletions

View file

@ -97,6 +97,8 @@ def completion(
elif model.split("/", 1)[0] in litellm.provider_list: # allow custom provider to be passed in via the model name "azure/chatgpt-test"
custom_llm_provider = model.split("/", 1)[0]
model = model.split("/", 1)[1]
if "replicate" == custom_llm_provider and "/" not in model: # handle the "replicate/llama2..." edge-case
model = custom_llm_provider + "/" + model
args = locals()
# check if user passed in any of the OpenAI optional params
optional_params = get_optional_params(