Skip to content

Commit e089efc

Browse files
authored
Add ko translations
1 parent ca53911 commit e089efc

File tree

1 file changed

+177
-0
lines changed

1 file changed

+177
-0
lines changed

21-meta/translations/ko/README.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Meta 패밀리 모델로 빌드하기
2+
3+
## 소개
4+
5+
이 강의에서는 다음 내용을 다룰 예정입니다.
6+
1. 두가지 주요 메타 패밀리 모델 : Llama 3.1과 Llama 3.2 탐색
7+
2. 각 모델의 사용 사례와 시나리오 이해
8+
3. 각 모델의 고유한 기능을 보여주는 예제 코드
9+
10+
# Meta 패밀리 모델
11+
12+
이 강의에서는 Meta 패밀리와 "Llama Herd"의 두가지 모델인 Llama 3.1과 Llama 3.2에 대해 알아보겠습니다.
13+
14+
이 모델들은 다양한 변형 버전으로 제공되며, GitHub 모델 마켓플레이스에서 사용할 수 있습니다. GitHub 모델을 통해 [AI 모델을 사용하여 프로토타입](https://docs.github.com/en/github-models/prototyping-with-ai-models?WT.mc_id=academic-105485-koreyst)을 만드는 자세한 내용은 다음과 같습니다.
15+
16+
17+
모델 변형:
18+
- Llama 3.1 - 70B Instruct
19+
- Llama 3.1 - 405B Instruct
20+
- Llama 3.2 - 11B Vision Instruct
21+
- Llama 3.2 - 90B Vision Instruct
22+
23+
Llama 3 모델도 GitHub 모델에 제공되지만, 이 강의에서는 다루지 않습니다.
24+
25+
*참고: Llama 3는 깃허브 모델에서도 사용할 수 있지만 이 레슨에서는 다루지 않습니다.*
26+
27+
28+
## Llama 3.1
29+
30+
4050억 개의 파라미터를 가진 Llama 3.1은 오픈 소스 대규모 언어 모델(LLM) 카테고리에 속합니다.
31+
32+
이 모델은 이전 버전인 Llama 3보다 다음의 향상된 기능을 제공합니다:
33+
34+
- 더 큰 컨텍스트 윈도우 : 8천 토큰에서 12만 8천 토큰으로 확대
35+
- 더 많은 최대 출력 토큰 수 : 2048에서 4096으로 증가
36+
- 향상된 다국어 지원 : 학습에 사용된 토큰 수 증가
37+
38+
이로 인해 Llama 3.1은 다음과 같은 복잡한 생성 AI 애플리케이션에서 더 효과적으로 활용될 수 있습니다.
39+
40+
- 네이티브 함수 호출: LLM 워크플로우 외부의 외부 도구 및 함수 호출 기능 제공
41+
- 향상된 RAG 성능: 더 큰 컨텍스트 윈도우 덕분에 성능이 향상됨
42+
- 합성 데이터 생성: 파인튜닝과 같은 작업을 위한 효율적인 데이터를 생성할 수 있는 기능
43+
44+
#### native 함수 호출
45+
46+
Llama 3.1은 함수나 도구 호출을 더 효과적으로 수행하도록 미세 조정되었습니다. 또한 사용자 프롬프트에 따라 모델이 필요할 때 자동으로 사용할 수 있는 두 가지 내장 도구가 있습니다. 이러한 도구는 다음과 같습니다:
47+
48+
- **Brave Search** - 날씨와 같은 최신 정보를 얻기 위해 웹 검색 수행
49+
- **Wolfram Alpha** - 복잡한 수학 계산을 수행하여 사용자가 직접 함수를 작성할 필요가 없음
50+
51+
여러분은 LLM에서 호출할 수 있는 사용자 지정 도구를 직접 만들 수도 있습니다.
52+
53+
### 아래의 코드 예제에서는:
54+
55+
- 시스템 프롬프트에 사용할 수 있는 도구들 (brave_search, wolfram_alpha)을 정의합니다.
56+
- 특정 도시의 날씨를 묻는 사용자 프롬프트를 보냅니다.
57+
- LLM은 Brave Search 도구 호출을 통해 응답하며, 다음과 같이 보입니다: `<|python_tag|>brave_search.call(query="Stockholm weather")`
58+
59+
*참고: 이 예제는 도구 호출만 수행하며, 실제 결과를 얻으려면 Brave API 페이지에서 무료 계정을 생성하고 함수를 정의해야 합니다.*
60+
61+
```python
62+
import os
63+
from azure.ai.inference import ChatCompletionsClient
64+
from azure.ai.inference.models import AssistantMessage, SystemMessage, UserMessage
65+
from azure.core.credentials import AzureKeyCredential
66+
67+
token = os.environ["GITHUB_TOKEN"]
68+
endpoint = "https://models.inference.ai.azure.com"
69+
model_name = "meta-llama-3.1-405b-instruct"
70+
71+
client = ChatCompletionsClient(
72+
endpoint=endpoint,
73+
credential=AzureKeyCredential(token),
74+
)
75+
76+
77+
tool_prompt=f"""
78+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
79+
80+
Environment: ipython
81+
Tools: brave_search, wolfram_alpha
82+
Cutting Knowledge Date: December 2023
83+
Today Date: 23 July 2024
84+
85+
You are a helpful assistant<|eot_id|>
86+
"""
87+
88+
messages = [
89+
SystemMessage(content=tool_prompt),
90+
UserMessage(content="What is the weather in Stockholm?"),
91+
92+
]
93+
94+
response = client.complete(messages=messages, model=model_name)
95+
96+
print(response.choices[0].message.content)
97+
```
98+
99+
## Llama 3.2
100+
101+
대규모 언어 모델(LLM)임에도 불구하고, Llama 3.1에는 멀티모달리티라는 한계가 있습니다. 즉, 이미지와 같은 다양한 유형의 입력을 프롬프트로 받아들이고 이에 응답합니다. 이 기능은 Llama 3.2의 주요 기능 중 하나입니다. Llama 3.2의 기능은 다음과 같습니다:
102+
103+
- 멀티모달리티: 텍스트뿐만 아니라 이미지 프롬프트도 평가할 수 있는 기능
104+
- 작은 크기부터 중간 크기까지의 변형(11B 및 90B): 유연한 배포 옵션 제공
105+
- 텍스트 전용 변형(1B 및 3B): 에지/모바일 장치에서 모델을 배포할 수 있으며 저지연성을 제공
106+
107+
멀티모달 지원은 오픈 소스 모델의 세계에서 큰 진전을 의미합니다. 아래 코드 예제는 이미지와 텍스트 프롬프트를 모두 사용하여 Llama 3.2 90B에서 이미지를 분석하는 예제입니다.
108+
109+
110+
### Multimodal Support with Llama 3.2
111+
112+
```python
113+
import os
114+
from azure.ai.inference import ChatCompletionsClient
115+
from azure.ai.inference.models import (
116+
SystemMessage,
117+
UserMessage,
118+
TextContentItem,
119+
ImageContentItem,
120+
ImageUrl,
121+
ImageDetailLevel,
122+
)
123+
from azure.core.credentials import AzureKeyCredential
124+
125+
token = os.environ["GITHUB_TOKEN"]
126+
endpoint = "https://models.inference.ai.azure.com"
127+
model_name = "Llama-3.2-90B-Vision-Instruct"
128+
129+
client = ChatCompletionsClient(
130+
endpoint=endpoint,
131+
credential=AzureKeyCredential(token),
132+
)
133+
134+
response = client.complete(
135+
messages=[
136+
SystemMessage(
137+
content="You are a helpful assistant that describes images in details."
138+
),
139+
UserMessage(
140+
content=[
141+
TextContentItem(text="What's in this image?"),
142+
ImageContentItem(
143+
image_url=ImageUrl.load(
144+
image_file="sample.jpg",
145+
image_format="jpg",
146+
detail=ImageDetailLevel.LOW)
147+
),
148+
],
149+
),
150+
],
151+
model=model_name,
152+
)
153+
154+
print(response.choices[0].message.content)
155+
```
156+
## 배움은 끝나지 않습니다. 계속 나아갑시다!
157+
이번 강의를 마치고 나서, [생성형 AI 학습 모음집](https://aka.ms/genai-collection?WT.mc_id=academic-105485-koreyst)을 확인하여, 계속해서 생성형 AI의 지식을 쌓아갑시다.
158+
159+
160+
161+
162+
163+
164+
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+

0 commit comments

Comments
 (0)