본문 바로가기
openai - 파인튜닝:튜닝자료(jsonl) {"prompt": "Context: The sun is a star.\nQuestion: What is the sun?", "completion": "The sun is a star."} {"prompt": "Context: The Earth is the third planet from the sun.\nQuestion: What is the position of Earth in the solar system?", "completion": "The Earth is the third planet from the sun."} {"prompt": "Context: Mount Everest is the highest mountain on Earth.\nQuestion: What is the highest mo.. 2023. 7. 13.
openai - 파인튜닝:모델명확인 import openai import datetime # OpenAI API 키 설정 openai.api_key = "[openai_api_key]" # 모든 모델 불러오기 response = openai.Model.list() def get_owner(model): if "owned_by" in model: # 만약 "owned_by" 필드가 존재하고 현재 사용자의 것일 경우 소유자로 반환 if model["owned_by"] == "user-5hpbi6qihf8tgrefddg9ok7f": return "Your Model" return f"owned_by" def convert_unix_timestamp(timestamp): dt = datetime.datetime.fromtimestamp(times.. 2023. 7. 13.
openai - 파인튜닝 현재 GPT-4로는 파인튜닝이 불가능하므로 GPT-3로 파인튜닝을 하고 있음 GPT-3 기반이 되는 학습모델은 대표적 총 4가지 1) davinci : GPT-3 시리즈 중 가장 성능이 좋은 모델, 요청당 최대 4,000개의 토근 처리 가능 (대화를 할수 있는 모델) 2) curie : 매우 유능하지만 davinci보다 빠르고 저렴 / 성능은 davinci가 우수 3) babbage : 간단한 작업이 가능하고 매우 빠르고 비용이 저렴 4) ada : 간단한 작업이 가능하므로 일반적으로 GPT-3 시리즈 중 가장 빠르고 가장 저렴 학습자료를 자세하고 다양한 형식의 prompt를 작성해야함 import time import openai # OpenAI API 키 설정 openai.api_key = "[ope.. 2023. 7. 13.
openai.Completion.create를 사용한 예제 import openai openai.api_key = "[openai_api_key]" system_message = f"You are an assistant that specializes in answering questions about office tasks and productivity, with a focus on email management. For more information, contact the representative email at rater@example.com." messages = [] important_keywords = ["업무", "이메일", "보고서", "회의", "프로젝트", "할당"] def contains_keywords(user_input): return a.. 2023. 7. 13.
openai.ChatCompletion.create를 사용한 예제 import openai openai.api_key = "[openai_api_key]" messages = [ { "role": "system", "content": "You are an assistant that specializes in answering questions about office tasks and productivity, with a focus on email management. You know the representative email address is [email protected]" }, { "role": "assistant", "content": "안녕하세요, 저는 업무 수행과 생산성에 관한 질문에 답을 제공하는 전문 도우미입니다. 특히 이메일 관리와 관련된 질문을 전문.. 2023. 7. 13.
openai.chatcompletion과 openai.Completion의 차이 기능openai.Completion.createopenai.ChatCompletion.create 목적 일반적인 텍스트 생성 대화형 채팅 입력형식 단일 프롬프트 단독 프롬프트에 응답을 얻는데 사용함 여러 채팅이력 대화의 이전 내용을 사용하여 응답을 가져오는데 사용함 다중 메시지 입력을 지원하여 질문-답변 시나리오 와 같은 대화식 시나리오에 적합 'prompt' 파라메터 프롬프트 텍스트 사용 사용되지 않음 'messages'파라메터 사용되지 않음 대화 이력 객체를 배열로 전달 파인튜닝 파인튜닝된 모델 지원 파인튜닝 지원하지 않고 기존모델에 대해서만 지원함 2023. 7. 13.
반응형