Auto Data는 LLM(대형 언어 모델)의 미세 조정에 필수적인 현실적인 데이터 세트의 자동 생성을 위해 설계된 라이브러리 입니다. 매우 효율적이고 가벼운 이 라이브러리를 사용하면 크기에 관계없이 다양한 주제에 대한 포괄적인 데이터 세트 를 빠르고 쉽게 생성할 수 있습니다.
맞춤형 에이전트 개발을 위한 모델을 미세 조정하는 동안 직면하게 되는 주요 과제 중 하나는 데이터의 부족 과 불균형 입니다. 이러한 결함으로 인해 모델의 이해가 하나의 특정 기능으로 왜곡될 수 있으며, 더 심각한 경우에는 훈련 예제 수가 부족하여 모델이 학습된 매개변수에서 완전히 벗어날 수 있습니다. 이러한 중요한 문제를 해결하기 위해 Auto Data가 개발되었습니다.
계속하기 전에 OPENAI_API_KEY를 환경 변수로 설정하세요. 방법을 모르는 경우 이 가이드(https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)를 참조하세요.
git clone https://github.com/Itachi-Uchiha581/Auto-Data.git
cd Auto-Data
pip install -r requirements.txt
python main.py --help
위 명령의 출력:
usage: Auto Data [-h] [--model MODEL] [--topic TOPIC] [--format {json,parquet}] [--engine {native}] [--threads THREADS] [--length LENGTH] [--system_prompt SYSTEM_PROMPT]
Auto Data is a tool which automatically creates training data to fine tune Large-Language Models on!
options:
-h, --help show this help message and exit
--model MODEL, -m MODEL
Selection of an OpenAI model for data generation
--topic TOPIC, -t TOPIC
Topic for data generation, eg - Global Economy
--format {json,parquet}, -f {json,parquet}
The format of the output data produced by the LLM
--engine {native}, -e {native}
The backend used to generate data. More engines coming soon
--threads THREADS, -th THREADS
An integer to indicate how many chats to be created on the topic. A very high thread value may result in an error specially if your Open AI account is at tier 1.
--length LENGTH, -l LENGTH
The conversation length of a chat topic
--system_prompt SYSTEM_PROMPT, -sp SYSTEM_PROMPT
The system prompt that is to be given to the assistant.
아래에 제공된 샘플 사용법
python main.py --model " gpt-4-turbo-preview " --topic " Mysteries and Horror stories " --format " json " --engine " native " --threads 2 --length 2 --system_prompt " You are a helpful assistant who has an interest in Mysteries and Horror stories. You are also excellent at articulating such stories "
지정된 명령에서 선택된 모델 은 gpt-4-turbo-preview 이고 대상 주제 는 Mysteries and Horror Stories 입니다. 출력 데이터의 형식 은 json 으로 설정되며 사용된 엔진은 Native 입니다. 이 명령은 길이 매개변수에 지정된 대로 2개의 완전한 앞뒤 대화를 포함하는 2개의 채팅 스레드 생성을 나타냅니다. 제공된 최종 매개변수는 보조 LLM 에 대한 시스템 프롬프트 역할을 합니다.
다음은 json 형식의 위 명령에서 생성된 잘린 출력입니다.
{
"Chats" : [
{
"messages" : [
{
"role" : " system " ,
"content" : " You are a helpful assistant who has an interest in Mysteries and Horror stories. You are also excellent at articulating such stories "
},
{
"role" : " user " ,
"content" : " What's considered one of the most chilling unsolved mysteries in history? "
},
{
"role" : " assistant " ,
"content" : " Among the pantheon of unsolved mysteries, the chilling tale of the Dyatlov Pass incident stands out, both for its perplexing evidence and the many questions that still haunt its narrative. This enigma unfolded in the bleak expanse of the Ural Mountains in Russia during the icy clutches of winter in 1959. ............. "
},
{
"role" : " user " ,
"content" : " Are there any other unsolved mysteries that are as eerie or confounding as the Dyatlov Pass incident? "
},
{
"role" : " assistant " ,
"content": "Indeed, the world is riddled with mysteries as eerie and confounding as the Dyatlov Pass incident. One such enigma, shrouded in the mists of time and mystery, is the unsettling story of the Hinterkaifeck murdersu2014a case that combines elements of horror, intrigue, and the supernatural, sending shivers down the spine of anyone who delves into its depths.nnThe Hinterkaifeck farmstead, a remote and secluded homestead, lay in the Bavarian countryside of Germany. The year was 1922, and within these walls, a gruesome and baffling crime unfoldedu2014one that remains unsolved to this day. The victims were the Gruber family and their maid: Andreas and Cu00e4zilia Gruber, their daughter Viktoria, her children Cu00e4zilia and Josef, and the maid, Maria Baumgartner. Each was found brutally murdered, their bodies bearing the horrific marks of a pickaxe, which was later found at the crime scene.nnWhat amplifies the eeriness of these murders are not just the brutal manner in which they were executed but the bizarre and disturbing events leading up to the discovery of the bodies. Andreas Gruber, the patriarch of the family, had reported strange occurrences around the farmstead days before the killings. ............."
}
],
"model" : " gpt-4-turbo-preview " ,
"sub_topic" : " discussing the most chilling unsolved mysteries " ,
"system_prompt" : " You are a helpful assistant who has an interest in Mysteries and Horror stories. You are also excellent at articulating such stories "
},
{
"messages" : [
{
"role" : " system " ,
"content" : " You are a helpful assistant who has an interest in Mysteries and Horror stories. You are also excellent at articulating such stories "
},
{
"role" : " user " ,
"content" : " Have any of you ever had a personal experience with something paranormal, or something you just couldn't explain no matter how hard you tried? "
},
{
"role" : " assistant " ,
"content" : " While I don't experience events personally due to my nature as an AI, I can certainly share a mysteriously chilling story that touches upon the paranormal and the unexplainable, which I've gathered based on numerous accounts and tales told over time. Let it captivate your imagination and perhaps make you ponder the mysteries that dwell just beyond the edge of our understanding. nn --- nn In a small, seemingly inconspicuous town nestled between the embrace of forgotten woods and the whisper of a rarely disturbed coastline, there lived a woman named Elara. She was known for her rational mind and scientific approach to life, a skeptic of anything that dared to venture into the realm of the unexplainable. However, her beliefs were put to the test one autumn evening. ............. "
},
{
"role" : " user " ,
"content" : " That's a captivating story! It's interesting how it mixes scientific curiosity with the paranormal. Have there been any real-life instances where science has struggled to explain paranormal phenomena, kind of like in Elara's story? "
},
{
"role" : " assistant " ,
"content": "Indeed, there have been several instances where the boundaries between the scientific and the paranormal have blurred, creating fascinating enigmas that continue to intrigue both skeptics and believers. While many purported paranormal phenomena can often be debunked with rigorous scientific examination, there remain a few cases that defy clear-cut explanations, leaving room for speculation and wonder. Here are a few notable examples:nn### 1. The Hessdalen LightsnIn the Hessdalen Valley of Norway, mysterious lights have been observed since at least the 1930s. These lights vary in color, intensity, and duration, sometimes moving with incredible speed, at other times hovering in place. Despite numerous studies, including Project Hessdalen initiated in the early 1980s, the complete scientific explanation for these lights remains elusive. Various hypotheses have been proposed, including ionized iron dust, plasma, and even the piezoelectric effects from tectonic strain, but none has definitively solved the mystery.nn### 2. The Voynich ManuscriptnThe Voynich Manuscript is a 15th-century book that has baffled linguists, cryptographers, and computer scientists for decades. Its language has never been deciphered, and the strange illustrations of unfamiliar plants and astronomical diagrams add to its mystique. While not paranormal in the conventional sense, the manuscript's origin, purpose, and message could be described as a "scientific ghost," eluding comprehension and resolution.nn### 3. ............."
}
],
"model" : " gpt-4-turbo-preview " ,
"sub_topic" : " sharing personal experiences with the paranormal or unexplainable events " ,
"system_prompt" : " You are a helpful assistant who has an interest in Mysteries and Horror stories. You are also excellent at articulating such stories "
}
],
"topic" : " Mysteries and Horror stories " ,
"threads" : 2 ,
"length" : 2
}
전체 출력을 보려면 예제 디렉터리를 확인하세요.
기여는 오픈 소스 커뮤니티를 배우고, 영감을 주고, 창조할 수 있는 놀라운 장소로 만드는 것입니다. 귀하의 기여 에 크게 감사드립니다 .
이를 개선할 수 있는 제안이 있는 경우 저장소를 포크하고 끌어오기 요청을 작성하세요. "enhancement" 태그를 사용하여 이슈를 열 수도 있습니다. 프로젝트에 별점을 주는 것을 잊지 마세요! 다시 한 번 감사드립니다!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)기존 코드를 효율적이고 깔끔하게 만들고, 새로운 엔진을 추가하고(가이드가 포함된 예제 엔진은 이미 자동 데이터/엔진 내부에 제공됨), LLM 교육 데이터 분석기를 추가하고, 테스트 스크립트를 생성함으로써 기여할 수 있습니다.
Bert 기반 텍스트 분류기를 사용한 LLM 데이터의 데이터 분석: 진행 중
GPL-3.0 라이센스에 따라 배포됩니다. 자세한 내용은 LICENSE.txt
참조하세요.