Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finetuned model ID mismatch between Python SDK and UI #490

Open
mdelrosa opened this issue May 3, 2024 · 1 comment
Open

finetuned model ID mismatch between Python SDK and UI #490

mdelrosa opened this issue May 3, 2024 · 1 comment

Comments

@mdelrosa
Copy link

mdelrosa commented May 3, 2024

Issue: When using the Python SDK to finetune a classification model, the returned ID does not match the correct model ID. More specifically, the ID in the Python SDK resembles ``, but the ID shown in the UI (i.e., the correct ID) resembles -ft.

Solution: have the GetFinetunedModelResponse in the Python SDK return the "correct" model ID that matches the ID shown in the UI.

Steps to Reproduce: To reproduce/get the ID in the Python SDK, you can do the following:

import cohere

COHERE_API_KEY = "YOUR_API_KEY"
co = cohere.Client(api_key=COHERE_API_KEY)

model = co.finetuning.create_finetuned_model(
	request=FinetunedModel(
		name="my-model-name",
		settings=Settings(
			base_model=BaseModel(
				base_type="BASE_TYPE_CLASSIFICATION",
			),
			dataset_id="my-dataset-id",
		),
	)
)
model_id = model.finetuned_model.id

clf_response = co.classify(
    inputs=["classify this!"],
    model=model_id
)

The co.classify call fails with the following error:

ApiError: status_code: 404, body: {'message': "model '<MODEL_UUID>' not found, make sure the correct model ID was used and that you have access to the model."}"

If we navigate to the UI, we find that the `` for the finetuned model has a "-ft" suffix, so the user can get around the ApiError just by running:

clf_response = co.classify(
    inputs=["classify this!"],
    model=model_id+"-ft"
)
@JulianArruti
Copy link

Same problem here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants