How to fine tune a model with already fine tuned model name?

We had uploaded our dataset file to OpenAI and fine tuned a model with davinci base model name. We got the fine_tuned_model name as davinci:ft-organization-name-2022-12-22-11-29-14.

Now we are planning to train and fine tune another dataset file. We want to fine tune the model with already fine tuned model (davinci:ft-organization-name-2022-12-22-11-29-14).

If I try to fine tune with already fine tuned model, I’m facing the below issue. And my uploaded file size is 14.8MB.

Could you please assist me how to achieve this in OpenAI?

Thanks in advance!y

Welcome to the community!

From the error it looks like you have a hard billing limit and fine-tuning the file will take you over that limit, so it’s failing …

Did you check your billing settings?

Good luck!

1 Like

Thanks for your response Paul!

Initially I have fine tuned with davinci model with a small data file (10KB) and it gets fine tuned with succeeded status. Also, I got fine_tuned_model name as davinci:ft-org-name-2022-12-22-11-29-14.

Response:

{
    "data": [
        {
            "created_at": 1671705275,
            "fine_tuned_model": "davinci:ft-org-name-2022-12-22-11-29-14",
            "hyperparams": {
                "batch_size": 1,
                "learning_rate_multiplier": 0.1,
                "n_epochs": 4,
                "prompt_loss_weight": 0.01
            },
            "id": "ft-e0IrBwFvFDMMZJPl2FCxBTBW",
            "model": "davinci",
            "object": "fine-tune",
            "organization_id": "org-etoq30QMSdIOT2QfJeLPIXrE",
            "result_files": [
                {
                    "bytes": 6424,
                    "created_at": 1671708555,
                    "filename": "compiled_results.csv",
                    "id": "file-JitfsAzLazbG7txiyJI5KgD0",
                    "object": "file",
                    "purpose": "fine-tune-results",
                    "status": "processed",
                    "status_details": null
                }
            ],
            "status": "succeeded",
            "training_files": [
                {
                    "bytes": 46150,
                    "created_at": 1671693460,
                    "filename": "blazor-speeddial.jsonl",
                    "id": "file-MSjf7HkykF19erFRSQMAZOaV",
                    "object": "file",
                    "purpose": "fine-tune",
                    "status": "processed",
                    "status_details": null
                }
            ],
            "updated_at": 1671708555,
            "validation_files": []
        }
    ],
    "object": "list"
}

Then, I tried to fine tune with another data file (size 9KB) with previously fine tuned model name (i.e.,) davinci:ft-org-name-2022-12-22-11-29-14 and i got the below response as failed status.

{
    "data": [
        {
            "created_at": 1672213412,
            "fine_tuned_model": null,
            "hyperparams": {
                "batch_size": null,
                "learning_rate_multiplier": null,
                "n_epochs": 4,
                "prompt_loss_weight": 0.01
            },
            "id": "ft-daUgFK1lmXgb2LeLWQncI4se",
            "model": "davinci:ft-org-name-2022-12-22-11-29-14",
            "object": "fine-tune",
            "organization_id": "org-etoq30QMSdIOT2QfJeLPIXrE",
            "result_files": [],
            "status": "failed",
            "training_files": [
                {
                    "bytes": 15228579,
                    "created_at": 1672213270,
                    "filename": "finetuning_prepared.jsonl",
                    "id": "file-2oviTsUgI4VYd5iR5QP2J0FE",
                    "object": "file",
                    "purpose": "fine-tune",
                    "status": "processed",
                    "status_details": null
                }
            ],
            "updated_at": 1672213501,
            "validation_files": []
        }
    ],
    "object": "list"
}

How could I fine tune with davinci:ft-org-name-2022-12-22-11-29-14 model again and again?

I’m interested in this question if anyone can help.

Hey, you can indeed fine-tune a fine-tuned model, see here: OpenAI API and please let me know if this doesn’t resolve the issue.

2 Likes

Can u pls provide the model name which u r using while retraining ur model?

Can any one plz guide me I am fine tuning the model with custom dataset manually via coding.
Is there any option on the official site of openai to re fine tune the already tunned model
note: I have first time fine tunned the model on their offical site but it is not giving accurate results now i want to refine tune the model so that i give better results, how i can?
https://platform.openai.com/finetune
plz anyone guide me Thankyou
@logankilpatrick

you can do it manually using job id and fine tune model id

Assuming you already have training_file_id and validation_file_id defined

Step 1: Start the fine-tuning job

try:
response = openai.FineTuningJob.create(
training_file=training_file_id,
validation_file=validation_file_id,
model=“ft:gpt-3.5-turbo-0125:smarty::97zV0KRm”, # Your model ID here
)

job_id = response["id"]
print("Fine-tuning job ID:", job_id)
print("Fine-tuning job response:", response)

except Exception as e:
print(f"An error occurred while starting fine-tuning: {e}")

Step 2: Check if the fine-tuning job was successful and get the new model ID

existing_model_id = response.get(“model”)

if existing_model_id:

print("Existing model ID:", existing_model_id)

try:
    # Start fine-tuning with the existing model
    response = openai.FineTuningJob.create(
        training_file=training_file_id,
        validation_file=validation_file_id,
        model=existing_model_id, # Use the existing model ID
    )

    new_model_id = response["id"]
    print(f"Fine-tuning completed! New model ID: {new_model_id}")
except Exception as e:
    print(f"An error occurred while fine-tuning with existing model: {e}")

else:
print(“No existing model ID found.”)

===========================================================================