Skip to content

Latest commit

 

History

History
189 lines (125 loc) · 15.2 KB

README.md

File metadata and controls

189 lines (125 loc) · 15.2 KB

FineTuning

(fine_tuning)

Overview

Fine-tuning API

Available Operations

list_jobs

Get a list of fine tuning jobs for your organization and user.

Example Usage

from beezy_ai import BeezyAI
import os

s = BeezyAI(
    api_key_auth=os.getenv("API_KEY_AUTH", ""),
)


res = s.fine_tuning.list_jobs(page=0, page_size=100, model="<value>", status="<value>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
page Optional[int] N/A
page_size Optional[int] N/A
model Optional[str] N/A
status Optional[str] N/A

Response

models.JobsOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

create_job

Create a new fine tuning job, it will be queued for processing.

Example Usage

import beezy_ai
from beezy_ai import BeezyAI
import os

s = BeezyAI(
    api_key_auth=os.getenv("API_KEY_AUTH", ""),
)


res = s.fine_tuning.create_job(model=beezy_ai.FineTuneableModel.OPEN_BEEZY_7B, training_files=[
    "7b5e7c53-8567-44dd-9c16-3076f8a2e0e0",
], hyperparameters={
    "training_steps": 518781,
}, validation_files=[
    "fc99e9da-aed7-494f-953d-6c88158a4ffd",
], suffix="<value>", integrations=[
    {
        "project": "<value>",
        "api_key": "<value>",
    },
])

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
model models.FineTuneableModel ✔️ The name of the model to fine-tune.
training_files List[str] ✔️ A list containing the IDs of uploaded files that contain training data.
hyperparameters models.TrainingParameters ✔️ The fine-tuning hyperparameter settings used in a fine-tune job.
validation_files List[str] A list containing the IDs of uploaded files that contain validation data.

If you provide these files, the data is used to generate validation metrics
periodically during fine-tuning. These metrics can be viewed in checkpoints
when getting the status of a running fine-tuning job.

The same data should not be present in both train and validation files.
suffix Optional[str] A string that will be added to your fine-tuning model name.
For example, a suffix of "my-great-model" would produce a model
name like ft:open-beezy-7b:my-great-model:xxx...
integrations List[models.WandbIntegration] A list of integrations to enable for your fine-tuning job.

Response

models.JobOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

get_job

Get a fine tuned job details by its UUID.

Example Usage

from beezy_ai import BeezyAI
import os

s = BeezyAI(
    api_key_auth=os.getenv("API_KEY_AUTH", ""),
)


res = s.fine_tuning.get_job(job_id="257ef09d-0e69-4109-84ae-b8b7297792c1")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
job_id str ✔️ N/A

Response

models.DetailedJobOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /

cancel_job

Request the cancellation of a fine tuning job.

Example Usage

from beezy_ai import BeezyAI
import os

s = BeezyAI(
    api_key_auth=os.getenv("API_KEY_AUTH", ""),
)


res = s.fine_tuning.cancel_job(job_id="c740f53a-b6a1-4a6f-8d63-2a6b7561e7b3")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
job_id str ✔️ N/A

Response

models.DetailedJobOut

Errors

Error Object Status Code Content Type
models.SDKError 4xx-5xx /