기술 및 지식 YAML 파일 생성
기술 및 지식 YAML 파일 생성에 대한 지침
초록
1장. taxonomy 트리 사용자 정의 링크 복사링크가 클립보드에 복사되었습니다!
RHEL AI 환경에서 지식 또는 기술 데이터로 taxonomy 트리를 수정하여 자체 사용자 지정 Granite Large Language Model(LLM)을 생성할 수 있습니다. RHEL AI에서 데이터 세트 생성 지식 및 기술은 YAML로 포맷됩니다. 이 YAML 구성을 qna.yaml 파일이라고 합니다. 여기서 "qna"는 질문 및 응답을 나타냅니다. taxonomy 트리는 qna.yaml 파일을 보유하는 분류 및 정보 분류 방법입니다.
다음 문서 섹션에서는 taxonomy 트리에 대한 기술 및 지식 qna.yaml 파일을 생성하는 방법을 설명합니다.
Starter Granite Cryostat를 교육하는 데 사용할 수 있는 몇 가지 지식 문서 유형이 있습니다. 현재 지원되는 문서 유형은 다음과 같습니다.
- Markdown
1.1. 기술 및 지식 개요 링크 복사링크가 클립보드에 복사되었습니다!
기술 및 지식 세트를 사용하고 도메인별 정보를 지정하여 사용자 지정 모델을 알릴 수 있습니다.
- 지식
- 정보 및 사실로 구성된 데이터 세트입니다. 모델에 대한 지식 데이터를 생성할 때 추가 데이터 및 정보를 제공하여 모델이 질문에 보다 정확하게 응답할 수 있도록 합니다.
- 기술
작업을 수행하는 방법을 모델을 알릴 수 있는 데이터 세트입니다. RHEL AI에 대한 기술은 카테고리로 나뉩니다.
구성 기술: 가정 기술을 통해 AI 모델이 특정 작업 또는 기능을 수행할 수 있습니다. 구성 기술은 다음 두 가지 유형이 있습니다.
- Freeform 구성 기술: 기능에 추가 컨텍스트 또는 정보가 필요하지 않은 수행 기술입니다.
- 기본 구성 기술: 이는 추가 컨텍스트가 필요한 수행 기술입니다. 예를 들어 모델에게 테이블을 읽도록 유도할 수 있습니다. 여기서 추가 컨텍스트는 테이블 레이아웃의 예입니다.
- Foundation Technology: Foundational 기술은 math, reasoning 및 coding을 포함하는 기술입니다.
추가 리소스
2장. taxonomy 트리에 대한 지식 추가 링크 복사링크가 클립보드에 복사되었습니다!
세로미 트리를 사용자 지정할 수 있으므로 모델이 도메인별 정보를 배울 수 있습니다. RHEL AI의 경우 지식 데이터는 Git 리포지토리에서 호스팅됩니다. 지식 기여는 qna.yaml 파일을 사용하여 모델을 학습하려는 문서를 읽는 방법을 알아봅니다. 지식을 위한 각 qna.yaml 파일에는 다음 키가 있는 키-값 항목 세트가 포함되어 있습니다.
| 필드 | 설명 | Constraints | 예 |
|---|---|---|---|
|
| qna.yaml 파일에 사용되는 taxonomy 스키마 버전입니다. |
이 매개변수에 현재 지원되는 값은 |
|
|
| 기여자의 이름 또는 사용자 이름입니다. | - |
|
|
| 지식 문서의 제목 또는 범주입니다. 도메인은 합성 데이터 생성 중에 마스터 모델에 메시지를 표시하고 추가 컨텍스트를 추가합니다. |
|
토론에 대한 지식 문서의 경우, 도메인은
건강 보험 정보에 대한 지식 문서의 경우 도메인은 |
|
| 기술 문서에서 컨텍스트와 함께 질문 및 응답 쌍을 포함하는 필드입니다. |
|
|
|
| 지식 문서에서 정확히 가져온 정보 청크입니다. 마스터 모델을 안내하는 데 도움이 되도록 표, 단락 또는 목록을 포함하여 다양한 유형의 콘텐츠를 강조 표시합니다. | 각 qna.yaml에는 5개의 컨텍스트 블록이 필요하며 최대 500개의 토큰 수가 있습니다. |
|
|
| 모델이 학습할 수 있는 질문 및 응답이 포함된 필드입니다. |
각 |
|
|
| 관련 컨텍스트와 관련이 있고 접지된 질문입니다. 사실 기반, 추론 또는 설명을 포함하여 다양한 질문 및 질문 유형을 제공합니다. | 최대 250개의 토큰 수입니다. |
|
|
|
지정된 질문에 대한 응답입니다. 답변은 완전한 문장이어야 하며 | 최대 250개의 토큰 수입니다. |
|
|
| 문서에 대한 간략한 요약은 Thesis 문과 유사합니다. 이는 문서 콘텐츠에 대한 높은 수준의 컨텍스트를 제공합니다. |
자세한 내용이어야 하며 |
|
|
| 기술 자료의 출처가 포함된 필드입니다. | - |
|
|
| 기술 자료 파일이 포함된 Git 리포지토리의 URL입니다. | - |
|
|
| 리포지토리의 문서에 해당하는 전체 커밋 해시 | - | - |
|
| Git 리포지토리에 파일을 포함 |
유효한 값에는 |
|
qna.yaml을 생성하기 위한 추가 리소스
-
예제 매개변수가 있는 전체
qna.yaml파일은 샘플 지식 YAML 사양 설명서를 참조하십시오. - YAML 큐레이션 프로세스에 대한 전체 지침은 모델 성능 설명서 최적화를 위한 YAML 생성 사례를 참조하십시오.
2.1. 지식 YAML 파일 생성 링크 복사링크가 클립보드에 복사되었습니다!
다음 프로세스는 RHEL AI 툴셋을 사용하여 제공된 기술 파일에 대해 교육하는 qna.yaml 파일을 생성하는 방법을 보여줍니다.
사전 요구 사항
- 부팅 가능한 컨테이너 이미지를 사용하여 RHEL AI를 설치했습니다.
- git CLI를 설치했습니다.
-
InstructLab을 초기화하고
ilabCLI를 사용할 수 있습니다. - 시스템에서 root 사용자 액세스 권한이 있어야 합니다.
프로세스
- Git 리포지토리에서 지식 파일을 호스팅하므로 과세 기간을 업데이트할 때 작업 분기를 체크아웃해야 합니다.
- taxonomy 폴더로 이동합니다. RHEL AI에는 상호 작용할 준비가 된 taxonomy 트리가 포함되어 있습니다.
- taxonomy 디렉터리의 지식 폴더로 이동합니다.
기술 자료
qna.yaml파일을 추가할 taxonomy 트리에 디렉터리와 폴더를 추가합니다.taxonomy 트리의 파일 경로 예
taxonomy/knowledge/technical_documents/product_customer_cases/qna.yaml원하는 텍스트 편집기를 사용하여
qna.yaml파일을 생성합니다. YAML에는qna.yaml제목이 있어야 합니다.참고SDG가 제대로 작동하려면
컨텍스트청크를 5개 이상 포함하고 질문_and_answers 매개변수의 컨텍스트 값에 따라 약 3개의 질문이포함되어야 합니다.-
qna.yaml파일에 필요한 키를 추가하고 변경 사항을 저장합니다.qna.yaml파일 포맷에 대한 자세한 내용은 "Sample knowledge YAML specifications"을 참조하십시오.
검증
지식
qna.yaml파일이 적절한 형식인지 확인하려면 다음 명령을 실행합니다.$ ilab taxonomy diffCLI는 taxonomy 트리 및
qna.yaml파일이 유효하고 올바르게 포맷된 경우 표시됩니다. CLI에는 오류가 발생하는 모든 문제를 수정할 수 있는 위치도 표시됩니다.유효한 taxonomy 트리 및
qna.yaml파일의 출력 예knowledge/technical_documents/product_customer_cases/qna.yaml Taxonomy in /taxonomy/ is valid :)오류가 있는 잘못된 taxonomy 트리 및
qna.yaml파일의 출력 예9:15 error syntax error: mapping values are not allowed here (syntax) Reading taxonomy failed with the following error: 1 taxonomy with errors! Exiting.
2.1.1. 샘플 지식 YAML 사양 링크 복사링크가 클립보드에 복사되었습니다!
지식 기여는 qna.yaml 파일을 사용하여 모델을 학습하려는 문서를 읽는 방법을 알아봅니다. RHEL AI에서 합성 데이터 생성(SDG) 프로세스는 qna.yaml 시드 예제를 사용하여 많은 양의 인공 데이터를 생성합니다. 이 프로세스를 통해 모델은 제공된 샘플에 독점적으로 의존하는 대신 더 많은 데이터를 학습할 수 있습니다.
기술 자료 qna.yaml 파일 예
version: 3
domain: astronomy
document_outline: |
Information about the Phoenix Constellation including the
history, characteristics, and features of the stars in the constellation.
created_by: <user-name>
seed_examples:
- context: |
**Phoenix** is a minor constellation in the southern sky. Named after the mythical
Phoenix_(mythology), it was first depicted on a celestial atlas by Johann Bayerin his 1603
Uranometria. The French explorer and astronomer Nicolas Louis de Lacaille charted the brighter stars
and gave their Bayer designations in 1756. The constellation stretches from roughly −39 degrees to −57
degrees declination, and from 23.5h to 2.5h of right ascension. The constellations Phoenix, Grus,
Pavo and Tucana are known as the Southern Birds.
questions_and_answers:
- question: |
What is the Phoenix constellation?
answer: |
The Phoenix constellation is a minor constellation in the southern sky.
- question: |
Who charted the Phoenix constellation?
answer: |
The Phoenix constellation was charted by french explorer and
astronomer Nicolas Louis de Lacaille.
- question: |
How far does the Phoenix constellation stretch?
answer: |
The phoenix constellation stretches from roughly −39° to −57°
declination, and from 23.5h to 2.5h of right ascension.
- context: |
Phoenix was the largest of the 12 constellations established by Petrus Plancius from the observations
of Pieter Dirkszoon Keyser and Frederick de Houtman. It first appeared on a 35cm diameter celestial globe
published in 1597 (or 1598) in Amsterdam by Plancius with Jodocus Hondius. The first depiction of this
constellation in a celestial atlas was in Johann Bayer *Uranometria* of 1603. De Houtman included it in
his southern star catalog the same year under the Dutch name *Den voghel Fenicx*, "The Bird Phoenix",
symbolising the phoenix of classical mythology. One name of the brightest star Alpha Phoenicis—Ankaa—is
derived from the Arabic: العنقاء, romanized: al-‘anqā’, lit. 'the phoenix', and was coined sometime after
1800 in relation to the constellation.
questions_and_answers:
- question: |
What is the brightest star in the Phoenix constellation
called?
answer: |
Alpha Phoenicis or Ankaa is the brightest star in the Phoenix
Constellation.
- question: Where did the Phoenix constellation first appear?
answer: |
The Phoenix constellation first appeared on a 35-cm diameter
celestial globe published in 1597 (or 1598) in Amsterdam by
Plancius with Jodocus Hondius.
- question: |
What does "The Bird Phoenix" symbolize?
answer: |
"The Bird Phoenix" symbolizes the phoenix of classical mythology.
- context: |
Phoenix is a small constellation bordered by Fornax and Sculptor to the north, Grus to the west,
Tucana to the south, touching on the corner of Hydrus to the south, and Eridanus to the east and southeast.
The bright star Achernar is nearby. The three-letter abbreviation for the constellation, as adopted by
the International Astronomical Union in 1922, is "Phe". The official constellation boundaries,
as set by Belgian astronomer Eugène Delporte in 1930, are defined by a polygon of 10 segments.
In the equatorial coordinate system, the right ascension coordinates of these borders lie
between 23<sup>h</sup> 26.5<sup>m</sup> and 02<sup>h</sup> 25.0<sup>m</sup>,
while the declination coordinates are between −39.31° and −57.84°. This means it remains
below the horizon to anyone living north of the 40th parallel in the Northern
Hemisphere, and remains low in the sky for anyone living north of the equator. It is most
visible from locations such as Australia and South Africa during late Southern Hemisphere spring.
Most of the constellation lies within, and can be located by, forming a triangle of the bright
stars Achernar, Fomalhaut and Beta Ceti—Ankaa lies roughly in the centre of this.
questions_and_answers:
- question: What are the characteristics of the Phoenix constellation?
answer: |
Phoenix is a small constellation bordered by Fornax and Sculptor to
the north, Grus to the west, Tucana to the south, touching on the
corner of Hydrus to the south, and Eridanus to the east and southeast.
The bright star Achernar is nearby.
- question: |
When is the phoenix constellation most visible?
answer: |
Phoenix is most visible from locations such as Australia and
South Africa during late Southern Hemisphere spring.
- question: |
What are the Phoenix Constellation boundaries?
answer: |
The official constellation boundaries for Phoenix, as set by Belgian
astronomer Eugène Delporte in 1930, are defined by a polygon of 10
segments.
- context: |
Ten stars have been found to have planets to date, and four planetary systems have been
discovered with the SuperWASP project. HD 142 is a yellow giant that has an apparent magnitude
of 5.7, and has a planet (HD 142b) 1.36 times the mass of Jupiter which orbits every 328 days.
HD 2039 is a yellow subgiant with an apparent magnitude of 9.0 around 330 light years away which
has a planet (HD 2039) six times the mass of Jupiter. WASP-18 is a star of magnitude 9.29 which
was discovered to have a hot Jupiter-like planet (WASP-18b) taking less than a day to orbit the star.
The planet is suspected to be causing WASP-18 to appear older than it really is. WASP-4and WASP-5
are solar-type yellow stars around 1000 light years distant and of 13th magnitude, each with a single
planet larger than Jupiter. WASP-29 is an orange dwarf of spectral type K4V and visual magnitude 11.3,
which has a planetary companion of similar size and mass to Saturn. The planet completes an orbit
every 3.9 days.
questions_and_answers:
- question: In the Phoenix constellation, how many stars have planets?
answer: |
In the Phoenix constellation, ten stars have been found to have
planets to date, and four planetary systems have been discovered
with the SuperWASP project.
- question: |
What is HD 142?
answer: |
HD 142 is a yellow giant that has an apparent magnitude of 5.7, and
has a planet (HD 142 b) 1.36 times the mass of Jupiter which
orbits every 328 days.
- question: |
Are WASP-4 and WASP-5 solar-type yellow stars?
answer: |
Yes, WASP-4 and WASP-5 are solar-type yellow stars around 1000 light
years distant and of 13th magnitude, each with a single planet
larger than Jupiter.
- context: |
The constellation does not lie on the galactic plane of the Milky Way, and there are no prominent star
clusters. NGC 625 is a dwarf irregular galaxy of apparent magnitude 11.0 and lying some 12.7 million
light years distant. Only 24000 light years in diameter, it is an outlying member of the Sculptor Group.
NGC 625 is thought to have been involved in a collision and is experiencing a burst of active star formation.
NGC 37 is a lenticular galaxy of apparent magnitude 14.66. It is approximately 42 kiloparsecs 137,000
light-years in diameter and about 12.9 billion years old. Robert's Quartet composed of the irregular galaxy
NGC 87, and three spiral galaxies NGC 88, NGC 89 and NGC 92 is a group of four galaxies located around 160 million
light-years away which are in the process of colliding and merging. They are within a circle of radius of 1.6 arcmin,
corresponding to about 75,000 light-years. Located in the galaxy ESO 243-49 is HLX-1, an intermediate-mass
black hole—the first one of its kind identified. It is thought to be a remnant of a dwarf galaxy that was absorbed
in a collision with ESO 243-49. Before its discovery, this class of black hole was only hypothesized.
questions_and_answers:
- question: |
Is the Phoenix Constellation part of the Milky Way?
answer: |
The Phoenix constellation does not lie on the galactic plane of
the Milky Way, and there are no prominent star clusters.
- question: |
How many light years away is NGC 625?
answer: |
NGC 625 is 24000 light years in diameter and is an outlying
member of the Sculptor Group.
- question: |
What is Robert's Quartet composed of?
answer: |
Robert's Quartet is composed of the irregular galaxy NGC 87,
and three spiral galaxies NGC 88, NGC 89 and NGC 92.
document:
repo: https://github.com/<profile>/<repo-name> /
commit: <commit hash>
patterns:
- phoenix_constellation.md
- phoenix_history.md
- 1
- 기술 자료
qna.yaml형식의 버전을 지정합니다. 현재 유효한 값은3입니다. - 2
- 문서의 제목 또는 범주를 지정합니다. 예를 들어 "기술 문서" 또는 "설치 가이드"입니다.
- 3
- 문서의 콘텐츠에 대한 개요를 지정합니다.
document_outline필드의context매개 변수에 포함하는 주체를 참조하는 것이 좋습니다. 예를 들어 문서가 설치 가이드이고 각컨텍스트에다른 클라우드 공급자에 대한 세부 정보가 포함된 경우document_outline은 "AWS, GCP 및 Azure 설치 가이드"가 됩니다. - 4
- 이름 또는 git 사용자 이름을 지정합니다.
- 5
- 기술 자료 단락을 지정합니다. 이는 귀하의 질문 및 답변을 기반으로 하는 내용입니다. 컨텍스트 블록 형식은 기술 자료 파일의 형식과 일치해야 합니다. 예를 들어 기술 문서가 마크다운에 있는 경우
컨텍스트블록도 마크다운 형식이어야 합니다. - 6
- 모델에 대한 질문을 지정합니다. 문제는
컨텍스트필드의 정보를 기반으로 해야 합니다. 예를 들어 "제품의 최신 버전은 무엇입니까?". - 7
- 모델에서 원하는 응답을 지정합니다. 답변에 대한 정보는
컨텍스트블록에서 포함하되 복사되지 않아야 하며 완전한 문장이어야 합니다. 답변은 완전한 문장이어야 합니다. 예를 들어 "제품의 최신 버전은 버전 1.5"입니다. - 8
- 기술 자료 파일이 포함된 리포지토리의 URL을 지정합니다.
- 9
- 기술 파일의 git 리포지토리에서 커밋의 SHA를 지정합니다.
- 10
- git 리포지토리에 문서를 지정합니다. 유효한 문서 유형 값에는
.md또는.pdf가 포함됩니다. 단일qna.yaml파일은 하나의 문서 유형만 참조할 수 있으며 동일한qna.yaml내의 파일 유형을 혼합하는 것은 지원되지 않습니다.
2.2. 지식 마크다운 파일 만들기 링크 복사링크가 클립보드에 복사되었습니다!
Red Hat Enterprise Linux AI 버전 1.5에서는 지식 문서 및 데이터를 Git 리포지토리 및 마크다운 형식으로 호스팅해야 합니다. 표준 git 워크플로를 사용하여 리포지터리에 파일을 생성하고 업로드할 수 있습니다. 다음을 포함하여 사용할 수 있는 다양한 오픈 소스 마크다운 변환 도구가 있습니다.
- Pandoc: 오픈 소스 변환 툴.
- 하나의 범위에서 Visual Studio Code를 사용하여 Visual Studio Code: You can open your document in Visual Studio Code, and use the Markdown All in One extensions to convert to Markdown.
- IBM Deepsearch/Docling: 번들 PDF 문서를 JSON으로 변환하고 자체 포함 패키지의 마크다운으로 변환합니다.
프로세스
- 선호하는 git 호스팅 플랫폼을 선택합니다. git과 호환되는 한 RHEL AI에서 모든 플랫폼을 사용할 수 있습니다.
문서를
.md마크다운 형식으로 변환합니다. 지식 데이터에 원하는 마크다운 변환 소프트웨어를 사용할 수 있습니다.다음 목록에는 지식 마크다운 파일에 대한 지침이 포함되어 있습니다.
- 모든 문서는 텍스트여야 하며 이미지는 현재 지원되지 않습니다.
- 문서에서 모든 발주를 제거하십시오.
- 테이블은 마크다운 형식이어야 합니다.
- 현재 차트와 그래프는 지원되지 않습니다.
-
파일 이름과 커밋 해시를 기록해 둡니다. 이 값은
qna.yaml파일에서 사용됩니다. md파일을 생성하고 Git 리포지토리에 업로드합니다.기술 문서의 마크다운 예
# Phoenix (constellation) **Phoenix** is a minor constellation in the southern sky. Named after the mythical phoenix, it was first depicted on a celestial atlas by Johann Bayer in his 1603 *Uranometria*. The French explorer and astronomer Nicolas Louis de Lacaille charted the brighter stars and gave their Bayer designations in 1756. The constellation stretches from roughly −39 degrees to −57 degrees declination, and from 23.5h to 2.5h of right ascension. The constellations Phoenix, Grus , Pavo and Tucana, are known as the Southern Birds. The brightest star, Alpha Phoenicis, is named Ankaa, an Arabic word meaning 'the Phoenix'. It is an orange giant of apparent magnitude 2.4. Next is Beta Phoenicis, actually a binary system composed of two yellow giants with a combined apparent magnitude of 3.3. Nu Phoenicis has a dust disk, while the constellation has ten star systems with known planets and the recently discovered galaxy clusters El Gordo and the Phoenix Cluster—located 7.2 and 5.7 billion light years away respectively, two of the largest objects in the visible universe. Phoenix is the radiant of two annual meteor showers: the Phoenicids in December, and the July Phoenicids. ## History Phoenix was the largest of the 12 constellations established by Petrus Plancius from the observations of Pieter Dirkszoon Keyser and Frederick de Houtman. It first appeared on a 35-cm diameter celestial globe published in 1597 (or 1598) in Amsterdam by Plancius with Jodocus Hondius. The first depiction of this constellation in a celestial atlas was in Johann Bayer's*Uranometria* of 1603. De Houtman included it in his southern star catalog the same year under the Dutch name *Den voghel Fenicx*, "The Bird Phoenix", symbolizing the phoenix of classical mythology. One name of the brightest star Alpha Phoenicis—Ankaa—is derived from the Arabic: العنقاء, romanized: al-‘anqā’, lit. 'the phoenix', and was coined sometime after 1800 in relation to the constellation. Celestial historian Richard Allen noted that unlike the other constellations introduced by Plancius and La Caille, Phoenix has actual precedent in ancient astronomy, as the Arabs saw this formation as representing young ostriches, *Al Ri'āl*, or as a griffin or eagle. In addition, the same group of stars was sometimes imagined by the Arabs as a boat, *Al Zaurak*, on the nearby river Eridanus. He observed, "the introduction of a Phoenix into modern astronomy was, in a measure, by adoption rather than by invention." The Chinese incorporated Phoenix's brightest star, Ankaa (Alpha Phoenicis), and stars from the adjacent constellation Sculptor to depict *Bakui*, a net for catching birds. Phoenix and the neighboring constellation of Grus together were seen by Julius Schiller as portraying Aaron the High Priest. These two constellations, along with nearby Pavo and Tucana, are called the Southern Birds. ## Characteristics Phoenix is a small constellation bordered by Fornax and Sculptor to the north, Grus to the west, Tucana to the south, touching on the corner of Hydrus to the south, and Eridanus to the east and southeast. The bright star Achernar is nearby. The three-letter abbreviation for the constellation, as adopted by the International Astronomical Union in 1922, is "Phe". The official constellation boundaries, as set by Belgian astronomer Eugène Delporte in 1930, are defined by a polygon of 10 segments. In the equatorial coordinate system, the right ascension coordinates of these borders lie between 23<sup>h</sup> 26.5<sup>m</sup> and 02<sup>h</sup> 25.0<sup>m</sup>, while the declination coordinates are between −39.31° and −57.84°. This means it remains below the horizon to anyone living north of the 40th parallel in the Northern Hemisphere, and remains low in the sky for anyone living north of the equator. It is most visible from locations such as Australia and South Africa during late Southern Hemisphere spring. Most of the constellation lies within, and can be located by, forming a triangle of the bright stars Achernar, Fomalhaut and Beta Ceti—Ankaa lies roughly in the centre of this.
3장. taxonomy 트리에 기술 추가 링크 복사링크가 클립보드에 복사되었습니다!
시작 모델은 qna.yaml 파일을 도메인별 기술로 채워 사용자 지정 기술을 배울 수 있습니다. 기술에 대한 각 qna.yaml 파일에는 다음 키가 있는 키-값 항목 세트가 포함되어 있습니다.
| 필드 | Desciption | restraints |
|---|---|---|
|
|
| 이 매개변수에 현재 지원되는 값은 2입니다. |
|
| Git 사용자 이름 또는 기여자 이름입니다. | 없음 |
|
| 귀하의 기술과 기능에 대한 설명입니다. | 없음 |
|
| 키 및 값 항목의 컬렉션입니다. |
각 |
|
| 접지된 기술은 사용자에게 모델이 기술을 실행하기 위해 알아야 하는 정보가 포함된 추가 컨텍스트를 제공해야 합니다. |
이 파일은 접착된 기술을 위해 필요합니다. 각 |
|
| 모델에 대한 질문을 지정합니다. |
각 |
|
| 모델에 대한 답변을 지정합니다. |
각 |
3.1. 기술 YAML 파일 생성 링크 복사링크가 클립보드에 복사되었습니다!
taxonomy 트리를 사용자 지정할 수 있으므로 모델이 원하는 사용 사례에 대한 새로운 기술을 배울 수 있습니다. 다음 절차에서는 기술 qna.yaml 파일이 포함된 taxonomy 트리를 생성하는 방법을 보여줍니다.
사전 요구 사항
- 부팅 가능한 컨테이너 이미지를 사용하여 RHEL AI를 설치했습니다.
-
InstructLab을 초기화하고
ilabCLI를 사용할 수 있습니다. - 시스템에서 root 사용자 액세스 권한이 있어야 합니다.
프로세스
taxonomy 디렉토리인
compositional_skills폴더로 이동합니다.중요기본 기술 생성, 코드 생성 기술은 현재 RHEL AI 버전 1.5에서 지원되지 않습니다.
트리에 존재하는 디렉터리에 따라 기술
qna.yaml파일을 추가할 트리에서 위치를 선택합니다.taxonomy 트리의 파일 경로 예
taxonomy/compositional_skills/grounded/<add_example>/qna.yaml원하는 텍스트 편집기를 사용하여
qna.yaml파일을 생성합니다.참고SDG가 올바르게 실행되려면
qna.yaml파일에 최소 5개의 질문 및 응답 쌍 예제를 포함해야 합니다.-
qna.yaml파일에 필요한 키를 추가하고 변경 사항을 저장합니다.qna.yaml파일 포맷에 대한 자세한 내용은 "Sample skill YAML 사양"을 참조하십시오.
검증
기술이 적절한 형식인지 확인하려면 다음 명령을 실행합니다.
$ ilab taxonomy diffCLI는 taxonomy 트리 및
qna.yaml파일이 유효하고 올바르게 포맷된 경우 표시됩니다. CLI는 또한 발생할 수 있는 오류를 수정할 위치를 표시합니다.유효한 taxonomy 트리 및
qna.yaml파일의 출력 예compositional_skills/writing/freeform/<example>/qna.yaml Taxonomy in /taxonomy/ is valid :)오류가 있는 잘못된 taxonomy 트리 및
qna.yaml파일의 출력 예6:11 error syntax error: mapping values are not allowed here (syntax) Reading taxonomy failed with the following error: 1 taxonomy with errors! Exiting.
3.2. 샘플 기술 YAML 사양 링크 복사링크가 클립보드에 복사되었습니다!
기술은 지식 YAML 파일과 유사한 질문 및 응답 레이아웃을 공유합니다. RHEL AI에서 합성 데이터 생성(SDG) 프로세스는 qna.yaml 시드 예제를 사용하여 사용자가 생성한 데이터에만 의존하는 대신 모델이 학습할 수 있는 많은 인공 데이터 세트를 생성합니다.
질문, 응답 및 컨텍스트 쌍의 순서는 SDG 또는 교육 프로세스에 영향을 미치지 않습니다. 자유형, 기반 및 기본 기술 범주로 구분되는 여러 유형의 기술이 있습니다. 다음 예제에서는 각 카테고리의 샘플을 볼 수 있습니다.
freeform 구성 기술 qna.yaml 파일의 예
version: 2
created_by: <user-name>
task_description: 'Teach the model how to rhyme.'
seed_examples:
- question: What are 5 words that rhyme with horn?
answer: warn, torn, born, thorn, and corn.
- question: What are 5 words that rhyme with cat?
answer: bat, gnat, rat, vat, and mat.
- question: What are 5 words that rhyme with poor?
answer: door, shore, core, bore, and tore.
- question: What are 5 words that rhyme with bank?
answer: tank, rank, prank, sank, and drank.
- question: What are 5 words that rhyme with bake?
answer: wake, lake, steak, make, and quake.
접지된 구성 기술 qna.yaml 파일의 예
version: 2
created_by: <user-name>
task_description: This skill provides the ability to read a markdown-formatted table.
seed_examples:
- context: |
| **Breed** | **Size** | **Barking** | **Energy** |
|----------------|--------------|-------------|------------|
| Afghan Hound | 25-27 in | 3/5 | 4/5 |
| Labrador | 22.5-24.5 in | 3/5 | 5/5 |
| Cocker Spaniel | 14.5-15.5 in | 3/5 | 4/5 |
| Poodle (Toy) | <= 10 in | 4/5 | 4/5 |
question: |
Which breed has the most energy?
answer: |
The breed with the most energy is the Labrador.
- context: |
| **Name** | **Date** | **Color** | **Letter** | **Number** |
|----------|----------|-----------|------------|------------|
| George | Mar 5 | Green | A | 1 |
| Gráinne | Dec 31 | Red | B | 2 |
| Abigail | Jan 17 | Yellow | C | 3 |
| Bhavna | Apr 29 | Purple | D | 4 |
| Rémy | Sep 9 | Blue | E | 5 |
question: |
What is Gráinne's letter and what is her color?
answer: |
Gráinne's letter is B and her color is red.
- context: |
| Banana | Apple | Blueberry | Strawberry |
|--------|------------|-----------|------------|
| Yellow | Red, Green | Blue | Red |
| Large | Medium | Small | Small |
| Peel | Peel | No peel | No peel |
question: |
Which fruit is blue, small, and has no peel?
answer: |
The blueberry is blue, small, and has no peel.
4장. 모델 성능을 최적화하기 위한 YAML 생성 사례 링크 복사링크가 클립보드에 복사되었습니다!
taxonomy tree 및 taxonomy 트리에 기술 추가 기술 추가에서 참조된 지침은 기술 및 지식 YAML 파일을 생성하는 데 대한 표준 지침을 제공합니다. 그러나 YAML 파일을 개선하여 생성된 syndetic 데이터를 최적화하고 더 높은 품질 모델을 생성할 수 있는 방법이 있습니다.
YAML 파일의 컨텍스트 필드에 있는 다양하고 포괄적인 콘텐츠
각 컨텍스트 블록에는 문서의 다양한 정보와 형식 유형이 포함되어야 합니다. 이를 통해 모델은 다양한 정보를 제공하는 방법을 배울 수 있습니다. 이러한 다양한 정보 프레젠테이션 유형에는 단락, 유형 테이블, 목록, 프로시저 및 정의가 포함될 수 있습니다.
컨텍스트 블록은 문서의 포괄적인 예여야 합니다. 컨텍스트 콘텐츠 및 Q&A 쌍의 총 길이는 750 토큰을 초과해서는 안 됩니다.
효과적인 질문 작성
질문은 모델이 답변할 수 있도록 원하는 질문 유형과 일치해야 합니다. 각 질문은 고유해야 하며 컨텍스트 필드의 정보를 참조해야 합니다. 전체 문장 질문을 포함하면 생성된 합성 데이터가 개선되고 모델 응답 품질이 향상됩니다.
효과적인 답변 작성
답변은 질문에 직접 응답하고 모델이 제공할 수 있는 응답 유형을 반영해야 합니다. 답변은 완전한 문장으로 되어 있어야 하며 원본 질문을 참조합니다. 전체 문장 응답을 포함하면 생성된 합성 데이터가 향상되고 모델 응답 품질이 향상됩니다.
답변은 컨텍스트 블록에서 직접 복사해서는 안되며, 이로 인해 모델이 추론 대신 추출을 배울 수 있습니다.
질문에 답변할 정보는 context 블록에 있어야 합니다. 정보가 별도의 컨텍스트 블록에 있거나 전혀 참조되지 않은 경우 모델을 사용할 수 있습니다.
수준 높은 질문 및 응답 쌍의 예
- question: How many eggs are needed to make roughly 24 chocolate chip cookies?
answer: You need around two eggs to make 24 chocolate chip cookies.
여러 문서 또는 여러 qna.yaml 파일을 사용하는 경우
여러 문서가 유사한 제목 또는 도메인과 관련된 경우 단일 qna.yaml 파일을 사용하는 것이 좋습니다. 각 qna.yaml 파일에는 단일 문서 유형이 포함되어야 하며 YAML 파일에서 문서 유형을 혼합할 수 없습니다.
문서가 관련이 없는 경우 별도의 qna.yaml 파일을 사용하는 것이 좋습니다.
YAML 파일에 링크 추가
모델은 링크를 암기할 수 있으므로 YAML 파일에 추가할 수 있습니다. 그러나 자주 변경되는 경우 하이퍼링크를 추가하지 않는 것이 좋습니다.