Skip to content

Commit

Permalink
move defaults to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-matton committed Aug 10, 2023
1 parent 43a8863 commit 38e9e3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
15 changes: 1 addition & 14 deletions cohere/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,25 +1009,12 @@ def create_custom_model(
"""
internal_custom_model_type = CUSTOM_MODEL_PRODUCT_MAPPING[model_type]

# Figuring out base model
if internal_custom_model_type in ["GENERATIVE", "CLASSIFICATION"]:
assert base_model is None, "base_model has to be None for generative and classification models"
internal_base_model = "medium"
elif internal_custom_model_type == "RERANK":
internal_base_model = base_model or "english"
assert internal_base_model in [
"english",
"multilingual",
], "base_model has to be `english` or `multilingual`"
else:
raise ValueError(f"Unsupported model_type: {internal_custom_model_type}")

json = {
"name": name,
"settings": {
"trainFiles": [],
"evalFiles": [],
"baseModel": internal_base_model,
"baseModel": base_model,
"finetuneType": internal_custom_model_type,
},
}
Expand Down
15 changes: 1 addition & 14 deletions cohere/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,25 +733,12 @@ async def create_custom_model(
"""
internal_custom_model_type = CUSTOM_MODEL_PRODUCT_MAPPING[model_type]

# Figuring out base model
if internal_custom_model_type in ["GENERATIVE", "CLASSIFICATION"]:
assert base_model is None, "base_model has to be None for generative and classification models"
internal_base_model = "medium"
elif internal_custom_model_type == "RERANK":
internal_base_model = base_model or "english"
assert internal_base_model in [
"english",
"multilingual",
], "base_model has to be `english` or `multilingual`"
else:
raise ValueError(f"Unsupported model_type: {internal_custom_model_type}")

json = {
"name": name,
"settings": {
"trainFiles": [],
"evalFiles": [],
"baseModel": internal_base_model,
"baseModel": base_model,
"finetuneType": internal_custom_model_type,
},
}
Expand Down

0 comments on commit 38e9e3b

Please sign in to comment.