makeBCT

#AI #OpenAI #Chatbot #Cloud #WordPress

OpenAI API : Create fine-tune 살펴 보겠습니다

지난 글에서 OpenAI API 중 Embeddings와 Files에 대해 알아 보았고, 이 글에서는 Fine-tunes에 대해 살펴 보겠습니다.

Fine-tunes API는 다음과 같이 총 6개 있습니다.

(1) Create fine-tune

RequestPOST https://api.openai.com/v1/fine-tunes
Request bodytraining_file (string / 필수)The ID of an uploaded fiel that contains training data.
validation_file (string / 옵션)The ID of an uploaded file that contains validation data.
model (string / 옵션)The name of the base model to fine-tune. You can select one of “ada”, “babbage”, “curie”, “davinci”, or a fine-tuned model created after 2022-04-21.
n_epochs (integer / 옵션)The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
batch_size (integer / 옵션)The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass.
learning_rate_multiplier (number / 옵션)The learning rate multiplier to use for trainng. The fine-tuning learning rate is the original learning rate used for pretraining multiplied
prompt_loss_weight (number / 옵션)The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt, and can add a stabilizing effect to training when completions are short.
compute_classification_metrics (boolean / 옵션)If set, we calculate classification-specific metrics such as accuracy and F1-score using the validation set at the end of every epoch.
classification_n_classes (integer / 옵션)The number of classes in a classification task.
classification_positive_class (string / 옵션)The positive class in binary classification.
classification_betas (array / 옵션)If this is provided, we calculate F-beta scores at the specified beta values. The F-beta score is a generalization of F-1 score. This in only used for binary classificiation.
suffix (string / 옵션)A string of up to 40 characters that will be added to your fine-tned model name.
Example requestcurl https://api.openai.com/v1/fine-tunes \
-H “Content-Type: application/json” \
-H “Authorization: Bearer $OPENAI_API_KEY” \
-d ‘{
“training_file”: “file-XGinujblHPwGLSztz8cPS8XY”
}’
Response{
“id”: “ft-AF1WoRqd3aJAHsqc9NY7iL8F”,
“object”: “fine-tune”,
“model”: “curie”,
“created_at”: 1614807352,
“events”: [
{
“object”: “fine-tune-event”,
“created_at”: 1614807352,
“level”: “info”,
“message”: “Job enqueued. Waiting for jobs ahead to complete. Queue number: 0.”
}
],
“fine_tuned_model”: null,
“hyperparams”: {
“batch_size”: 4,
“learning_rate_multiplier”: 0.1,
“n_epochs”: 4,
“prompt_loss_weight”: 0.1,
},
“organization_id”: “org-…”,
“result_files”: [],
“status”: “pending”,
“validation_files”: [],
“training_files”: [
{
“id”: “file-XGinujblHPwGLSztz8cPS8XY”,
“object”: “file”,
“bytes”: 1547276,
“created_at”: 1610062281,
“filename”: “my-data-train.jsonl”,
“purpose”: “fine-tune-train”
}
],
“updated_at”: 1614807352,
}

나머지는 다음 글에서 살펴 보겠습니다.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

인기 글

Ubuntu 22.04 LTS에 Python 3.8 or 3.9 설치 방법
서버 : Vultr 클라우드OS: Ubuntu 22.04 LTS사용자 계정 생성하여 설치 진행함1. Start with the system updatesudo apt update...
오라클 클라우드 OCI 가입 드디어 성공 했습니다 (상세 후기)
2023년 2월 16일에 ‘오라클 클라우드 지급 검증 실패 글‘을 남긴 적이 있습니다.그 때 검색을 통해 해결 방법을 찾아 보았고, 당시 성공했던 분들의...
WSL2/Ubuntu 22.04 LTS에 Anaconda 설치 
WSL2/Ubuntu 환경에서 Python 버전별로 가상환경을 만드는 방법 중 그나마 Anaconda 방법이 좋은 것 같네요. 설치 방법은 간단합니다.1. apt update사용자...
Permission denied (publickey) 해결 방법
Plesk에서 생성된 system user로 ftp 접속 시 다음과 같은 에러 메시지가 발생하면서 접속이 되지 않습니다.상태: 152.67.193.32:49152에 연결... 응답: fzSftp...
사용자 작성 모듈 import 시 에러)(ModuleNotFoundError: No module named
파이썬 모듈을 만들고 테스트 할 때 ModuleNotFoundError: No module named 에러가 발생한 경우원인파이썬은 모듈을 불러올 때 모듈 설치 경로와 자신의...

BCT Ai Chatbot

답변을 준비중입니다 . . .