OpenAI API : Files 살펴 보겠습니다

정의

Files are used to upload documents that can be used with features like Fine-tuning.

API

총 5개 API가 있습니다.

List files / Upload file / Delete file / Retrieve file / Retrieve file content

이 중 (2) Upload file에 대해 알아보겠습니다.

Upload file

POST https://api.openai.com/v1/files

Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of the files uploaded by one organization can be up to 1GB.

Request body

file (string / 필수)Name of the JSON Lines file to be uploaded.If the purpose is set to “fine-tune”, ech line is a JSON record with “prompt” and “completion” fields representing your training examples.
purpose (string / 필수)The intended purpose of the uploaded documents.Use “fine-tune” for Fine-tuning. This allows us to validate the format of the uploaded file.

Example request

curl https://api.openai.com/v1/files \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F purpose="fine-tune" \
  -F file="@mydata.jsonl"

Response

{
  "id": "file-XjGxS3KTG0uNmNOK362iJua3",
  "object": "file",
  "bytes": 140,
  "created_at": 1613779121,
  "filename": "mydata.jsonl",
  "purpose": "fine-tune"
}

결과

API 결과는 다음과 같습니다.

Leave a Reply

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

인기 글

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일에 ‘오라클 클라우드 지급 검증 실패 글‘을 남긴 적이 있습니다.그 때 검색을 통해 해결 방법을 찾아 보았고, 당시 성공했던 분들의...
회사 도메인으로 무료 회사 메일 만드는 방법 정리
회사 도메인으로 무료 메일 만드는 방법에는 네이버, 다음, 구글 메일서버를 이용하는 방법이 있었는데, 근래 네이버, 구글의 ㄱㅇ우 유료 서비스로 전환되어 현재는 Daum 스마트워크를...
WSL2/Ubuntu 22.04 LTS에 Anaconda 설치 
WSL2/Ubuntu 환경에서 Python 버전별로 가상환경을 만드는 방법 중 그나마 Anaconda 방법이 좋은 것 같네요. 설치 방법은 간단합니다.1. apt update사용자...
Ubuntu 20.04에 MySQL 5.7 설치
비씨티원 인공지능 서비스 플랫폼 BAP(Bctone AI service Platform)의 설치 환경은 공식적으로 Ubuntu 18.04와 MySQL 버전 5.7 입니다. 최근 Ubuntu...