import os
from openai import OpenAI
os.environ["OPENAI_API_KEY"] = "<OPENAI_API_KEY>"
openAI = OpenAI()
findTuningJobID = "ftjob-HkgAjAxQoiLDyPTOPLGuhPSz" # 파인튜닝 작업 ID를 설정한다.
fineTuningJobEvent = openAI.fine_tuning.jobs.list_events(fine_tuning_job_id = findTuningJobID, limit = 10)
print(fineTuningJobEvent)
"""
SyncCursorPage[FineTuningJobEvent](
data = [
FineTuningJobEvent(
id = 'ftevent-84B7oTOBmFGBMrRmitV79Rgj',
created_at = 1717683980,
level = 'info',
message = 'The job has successfully completed',
object = 'fine_tuning.job.event',
data = {},
type = 'message'
),
FineTuningJobEvent(
id = 'ftevent-AQjJYDTcjZu7aao660LSs4LU',
created_at = 1717683975,
level = 'info',
message = 'New fine-tuned model created: ft:davinci-002:personal::9X8MBUWt',
object = 'fine_tuning.job.event',
data = {},
type = 'message'
),
FineTuningJobEvent(
id = 'ftevent-6nPv8YTsWnRpBefyOzP5YaEL',
created_at = 1717683975,
level = 'info',
message = 'Checkpoint created at step 864 with Snapshot ID: ft:davinci-002:personal::9X8MAsN5:ckpt-step-864',
object = 'fine_tuning.job.event',
data = {},
type = 'message'
),
FineTuningJobEvent(
id = 'ftevent-zfcvOwQx3OGrMlBmRXCgTxR5',
created_at = 1717683975,
level = 'info',
message = 'Checkpoint created at step 432 with Snapshot ID: ft:davinci-002:personal::9X8MAiDR:ckpt-step-432',
object = 'fine_tuning.job.event',
data = {},
type = 'message'
),
FineTuningJobEvent(
id = 'ftevent-JilmgcUW2zAJFE9YAU7f2kHg',
created_at = 1717683970,
level = 'info',
message = 'Step 1296/1296: training loss=0.64',
object = 'fine_tuning.job.event',
data = {'step' : 1296, 'train_loss' : 0.6408401131629944, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.8474576473236084},
type = 'metrics'
),
FineTuningJobEvent(
id = 'ftevent-Yh9tnBK1QkuNQSayznHa8YjX',
created_at = 1717683956,
level = 'info',
message = 'Step 1295/1296: training loss=0.95',
object = 'fine_tuning.job.event',
data = {'step' : 1295, 'train_loss' : 0.9544574022293091, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.7313432693481445},
type = 'metrics'
),
FineTuningJobEvent(
id = 'ftevent-RiGPQYvnJ0BIuPJM1S0i8cfl',
created_at = 1717683956,
level = 'info',
message = 'Step 1294/1296: training loss=0.61',
object = 'fine_tuning.job.event',
data = {'step' : 1294, 'train_loss' : 0.609065055847168, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.9285714030265808},
type = 'metrics'
),
FineTuningJobEvent(
id = 'ftevent-DubNKtgc4zqEJUnZEWx2EYPf',
created_at = 1717683956,
level = 'info',
message = 'Step 1293/1296: training loss=0.49',
object = 'fine_tuning.job.event',
data = {'step' : 1293, 'train_loss' : 0.4858061373233795, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.9047619104385376
},
type = 'metrics'
),
FineTuningJobEvent(
id = 'ftevent-8IXDJTfL3AUlUMcWFRT1bA1v',
created_at = 1717683956,
level = 'info',
message = 'Step 1292/1296: training loss=0.66',
object = 'fine_tuning.job.event',
data = {'step' : 1292, 'train_loss' : 0.6558962464332581, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.8139534592628479},
type ='metrics'
),
FineTuningJobEvent(
id = 'ftevent-QupNJKrSBCkW8gcGA4YOmbmn',
created_at = 1717683956,
level = 'info',
message = 'Step 1291/1296: training loss=0.67',
object = 'fine_tuning.job.event',
data = {'step' : 1291, 'train_loss' : 0.6663717031478882, 'total_steps' : 1296, 'train_mean_token_accuracy' : 0.8157894611358643},
type = 'metrics'
)
],
object = 'list',
has_more = True
)
"""