DEV/nlp

Mac OS / Windows Ollama로 eeve 모델 설치하여 사용하기

석봉 2024. 9. 25. 18:04

M1, M2, M3 실리콘 맥 시리즈에서 Ollama로 eeve를 등록하여 사용해 보았습니다.

(Windows도 동작 확인 완료)

 

ollama install : https://github.com/ollama/ollama

 

GitHub - ollama/ollama: Get up and running with Llama 3.1, Mistral, Gemma 2, and other large language models.

Get up and running with Llama 3.1, Mistral, Gemma 2, and other large language models. - ollama/ollama

github.com

 

그 다음 사용할 모델인 eeve를 준비합니다. (https://huggingface.co/heegyu/EEVE-Korean-Instruct-10.8B-v1.0-GGUF)

 

가장 작은 모델은 하당 링크를 통해 받을 수 있습니다.

https://huggingface.co/heegyu/EEVE-Korean-Instruct-10.8B-v1.0-GGUF/resolve/main/ggml-model-Q4_K_M.gguf?download=true

 

그 다음 Ollama에 등록하기 위해 다음과 같은 문서를 생성합니다.

 

각 OS에 맞게 에디터를 이용하시면 됩니다.

(notepad, note, vi, vim, vsCode 등...)


* 파일 경로는 자신이 다운로드받은 파일 경로로 수정!

* Mac OS 이용자의 경우 (경로만 다르지 사실 똑같다)

 

파일명 : eeveModel

FROM /Users/seokbong/Desktop/Dev/dir/Python/NLP/eeve/ggml-model-Q4_K_M.gguf

TEMPLATE """### User:
{{ .Prompt }}

### Assistant:
"""

# 매개변수 설정
PARAMETER temperature 0.1
PARAMETER num_ctx 2048

PARAMETER stop "</s>"
PARAMETER stop "### System:"
PARAMETER stop "### User:"
PARAMETER stop "### Assistant:"

* 파일 경로는 자신이 다운로드받은 파일 경로로 수정!

* Windows OS 이용자의 경우 (경로만 다르지 사실 똑같다)

* num_gpu : 그래픽 사용 여부

파일명 : eeveModel

FROM C:\Users\ME\Desktop\workspace\eeve\ggml-model-Q4_K_M.gguf

TEMPLATE """
### User:
{{ .Prompt }}

### Assistant:
"""

# 매개변수 설정
PARAMETER temperature 0.1
PARAMETER num_ctx 4096
PARAMETER num_gpu 0

PARAMETER stop "</s>"
PARAMETER stop "### System:"
PARAMETER stop "### User:"
PARAMETER stop "### Assistant:"

 

gguf 파일 다운로드가 완료되면 다음과 같은 명령어를 통해 등록하자.

 

// 모델 등록 (success 출력이 된다면 install 완료...!)
ollama create eeve:q4 -f eeveModel

// 모델 확인
ollama list

// 모델 실행
ollama run eeve:q4 {질문 내용}

// 모델 제거
ollama rm eeve:q4

 

 

 


ref

https://amnesia.tistory.com/m/52

 

M1 Ollama+Gemma+LangChain 설치하고 간단히 돌려보기

해당 내용은 Mac (M1) 을 기준으로 작성되었습니다. 대규모 언어 모델을 로컬에서 실행하기 위해서 Ollama를 설치하고 구글의 최첨단 경량 오픈모델인 gemma를 다운받아서 간단히 돌려보고 LangChain으

amnesia.tistory.com

https://amnesia.tistory.com/m/53

 

M1 Ollama로 경량화 한글모델 eeve GGUF 모델 설치 및 LangChain

앞에서 Ollama로 Gemma 경량화 모델을 실행해봤습니다. 이번엔 한글을 지원하는 경량화 모델중에 https://huggingface.co/heegyu/EEVE-Korean-Instruct-10.8B-v1.0-GGUF heegyu/EEVE-Korean-Instruct-10.8B-v1.0-GGUF · Hugging Face Usag

amnesia.tistory.com