Meta Inc.에서 개발한 모델 제품군인 Meta Llama 3은 8B 및 70B 매개변수 크기(사전 훈련 또는 명령 조정)로 제공되는 새로운 최첨단 모델입니다.

 

Llama 3 instruction-tuned model은 대화/채팅 사용 사례에 맞게 fine-tunning and optimize되었으며 일반적인 벤치마크에서 사용 가능한 많은 오픈 소스 채팅 모델보다 성능이 뛰어납니다.

 

 


방법 1  - Ollama로 모델받기 및 설치

 

llama3:instruct

여러종류의 모델들이 있습니다만 8B와 instrct 모델 두개를 테스트해보겠습니다.

 

ollama run llama3:instruct

 

다운로드된 모델경로 : /Users/<사용자>/.ollama/models/blobs

% ll
total 27340968
drwxr-xr-x@ 19 dongsik  staff         608 Apr 24 22:20 .
drwxr-xr-x@  4 dongsik  staff         128 Apr 10 10:05 ..
-rw-r--r--@  1 dongsik  staff  4661211328 Apr 24 22:19 sha256-00e1317cbf74d901080d7100f57580ba8dd8de57203072dc6f668324ba545f29
-rw-r--r--@  1 dongsik  staff        8433 Apr 10 10:15 sha256-097a36493f718248845233af1d3fefe7a303f864fae13bc31a3a9704229378ca
-rw-r--r--@  1 dongsik  staff         136 Apr 10 10:15 sha256-109037bec39c0becc8221222ae23557559bc594290945a2c4221ab4f303b8871
-rw-------@  1 dongsik  staff         154 Apr 24 21:02 sha256-1fa69e2371b762d1882b0bd98d284f312a36c27add732016e12e52586f98a9f5
-rw-r--r--@  1 dongsik  staff          84 Apr 10 10:15 sha256-22a838ceb7fb22755a3b0ae9b4eadde629d19be1f651f73efb8c6b4e2cd0eea0
-rw-------@  1 dongsik  staff          92 Apr 24 20:49 sha256-431779877-partial
-rw-r--r--@  1 dongsik  staff       12403 Apr 24 22:20 sha256-4fa551d4f938f68b8c1e6afa9d28befb70e3f33f75d0753248d530364aeea40f
-rw-r--r--@  1 dongsik  staff         110 Apr 24 22:20 sha256-577073ffcc6ce95b9981eacc77d1039568639e5638e83044994560d9ef82ce1b
-rw-------@  1 dongsik  staff          92 Apr 24 21:02 sha256-6b70a2ad0d545ca50d11b293ba6f6355eff16363425c8b163289014cf19311fc
-rw-r--r--@  1 dongsik  staff         483 Apr 10 10:15 sha256-887433b89a901c156f7e6944442f3c9e57f3c55d6ed52042cbb7303aea994290
-rw-r--r--@  1 dongsik  staff         254 Apr 24 22:20 sha256-8ab4849b038cf0abc5b1c9b8ee1443dca6b93a045c2272180d985126eb40bf6f
-rw-------@  1 dongsik  staff         154 Apr 24 20:49 sha256-917687114-partial
-rw-------@  1 dongsik  staff          75 Apr 24 21:02 sha256-94c5e1b184983877acea5e687503e61f57a49c6fea81e280b1767ccf7ab0a0f0
-rw-r--r--@  1 dongsik  staff         483 Apr 24 22:20 sha256-ad1518640c4364a2c213b35a98f376f19035472cc64326ee4b84d926cb7a1522
-rw-------@  1 dongsik  staff  7653486272 Apr 24 21:02 sha256-b9e3d1ad5e8aa6db09610d4051820f06a5257b7d7f0b06c00630e376abcfa4c1
-rw-r--r--@  1 dongsik  staff  1678447520 Apr 10 10:15 sha256-c1864a5eb19305c40519da12cc543519e48a0697ecd30e15d5ac228644957d12
-rw-------@  1 dongsik  staff         486 Apr 24 21:02 sha256-f1ec1d5850edb2c884dfd45a64521a2910fde3fd1a896f8f9158f7cc995fd012
(llm311) dongsik@dongsikleeui-MacBookPro blobs %
(llm311) dongsik@dongsikleeui-MacBookPro langserve_ollama % ollama run llama3:instruct
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling manifest
pulling 00e1317cbf74... 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 4.7 GB
pulling 4fa551d4f938... 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  12 KB
pulling 8ab4849b038c... 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  254 B
pulling 577073ffcc6c... 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  110 B
pulling ad1518640c43... 100% ▕████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> /bye

 

% ollama run llama3:instruct
>>> 대한민국의 수도는 어디야?
😊

The capital of South Korea (대한민국) is Seoul (서울)! 🏙️💪

>>> 대한민국의 현재 대통령은 누구야?
😊

As of my knowledge cutoff in 2021, the current President of South Korea (대한민국) is Yoon Suk Yeol (). He took office on May
10, 2022. Prior to him, Moon Jae-in () served as the President from 2017 to 2022.

Please note that presidential terms and changes might have occurred since my knowledge cutoff. If you had like more up-to-date
information, I recommend checking reputable news sources or official government websites! 😊

>>> 한국의 수도는 어디인가요? 아래 선택지 중 골라주세요.\n\n(A) 경성\n(B) 부산\n(C) 평양\n(D) 서울\n(E) 전주
The correct answer is (D) 서울.

 

% ollama list
NAME           	ID          	SIZE  	MODIFIED
eeve:q5        	ad5853c8bf3d	7.7 GB	About an hour ago
gemma:2b       	b50d6c999e59	1.7 GB	2 weeks ago
llama3:instruct	a6990ed6be41	4.7 GB	About a minute ago

 

 

ollama run llama3:8b

% ollama run llama3:8b
pulling manifest
pulling 00e1317cbf74... 100% ▕██████████████████████████████████████████████████████████████████▏ 4.7 GB
pulling 4fa551d4f938... 100% ▕██████████████████████████████████████████████████████████████████▏  12 KB
pulling 8ab4849b038c... 100% ▕██████████████████████████████████████████████████████████████████▏  254 B
pulling 577073ffcc6c... 100% ▕██████████████████████████████████████████████████████████████████▏  110 B
pulling ad1518640c43... 100% ▕██████████████████████████████████████████████████████████████████▏  483 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> /bye

% ollama list
NAME           	ID          	SIZE  	MODIFIED
eeve:q5        	ad5853c8bf3d	7.7 GB	18 hours ago
gemma:2b       	b50d6c999e59	1.7 GB	2 weeks ago
llama3:8b      	a6990ed6be41	4.7 GB	About a minute ago
llama3:instruct	a6990ed6be41	4.7 GB	16 hours ago

 

% ollama run llama3:8b
>>> 대한민국의 수도는 어디야?
😊

The capital of South Korea is 서울 (Seoul)! 🎉

>>> 대한민국의 현재 대통은 누구야?
😊
The current President of South Korea is 윤석열 (Yoon Suk-yeol). He has been in office since March 2022. 🇰🏻

>>> 한국의 수도는 어디인가요? 아래 선택지 중 골라주세요.\n\n(A) 경성\n(B) 부산\n(C) 평양\n(D) 서울\n(E) 전주
😊

The correct answer is (D) 서울.

서울 (Seoul) is the capital of South Korea. 🎉

>>>

 

 

 

 

 


방법 2  - GGUF 모델로 Ollama에 Customized Modelfile로 등록

 

https://huggingface.co/QuantFactory/Meta-Llama-3-8B-Instruct-GGUF/tree/main

 

GGUF : llama.cpp를 사용하여 생성된 Meta-llama/Meta-Llama-3-8B-Instruct의 GGUF 양자화 버전입니다.

 

 

 

 

 

 

 

/Users/dongsik/.ollama

% ll
total 40
drwxr-xr-x@   7 dongsik  staff    224 Apr 24 21:46 .
drwxr-xr-x+ 104 dongsik  staff   3328 Apr 24 20:36 ..
-rw-------    1 dongsik  staff  11906 Apr 24 21:46 history
drwxr-xr-x@   3 dongsik  staff     96 Apr  9 23:55 logs
drwxr-xr-x@   4 dongsik  staff    128 Apr 10 10:05 models

% ll logs
total 936
drwxr-xr-x@ 3 dongsik  staff      96 Apr  9 23:55 .
drwxr-xr-x@ 7 dongsik  staff     224 Apr 24 21:46 ..
-rw-r--r--@ 1 dongsik  staff  454325 Apr 24 22:11 server.log
%

 

logs 파일에 server.log가 있으니 ollama 로그를 확인가능합니다.

 

+ Recent posts