-
2024.10. LogicKor 최고 모델 NCSOFT/Llama-varco-8b 모델을 가볍게 만들어 허깅페이스에 올려봅시다!! GGUF, LLM 양자화카테고리 없음 2024. 10. 4. 22:59
지금까지 몇개의 앱을 만들때 사용했던 GGUF포맷은 Georgi Gerganov가 만든 딥러닝 모델 저장용 단일 파일 포맷입니다. 이 포맷은 LLM(Large Language Model)에 주로 활용됩니다. 개발자가 자랑스레 만든 GGUF 파일은 LLM모델을 하나의 파일로 만들어 배포와 사용을 간편하게 만듭니다. 그리고 양자화를 통해 모델을 더 작게 만들어 추론 속도를 높이고, 메모리 사용을 줄여 일반 사용자들의 접근을 높이는 중요한 역할을 합니다. 양자화는 모델의 크기를 축소하고 추론 속도를 향상시키는 기술로, 특히 LLM에서 효과적입니다. 모델의 가중치와 활성화를 저정밀도로 변환하여 메모리 사용량을 줄이고 계산 속도를 높이는 방법입니다. 예를 들어, 32비트 부동소수점 수치를 8비트 정수로 변환하면 메모리 사용량이 약 4분의 1로 감소하고, 계산 속도도 크게 향상됩니다. GGUF 파일 안에는 모델의 가중치(weight) 텐서 값들과 메타데이터가 Key-Value 형식으로 저장되며 모델의 구조, 버전, 텐서 개수 등을 포함합니다. GGUF는 16-bit 부동 소수점(floating point)뿐만 아니라 8-bit, 6-bit, 5-bit, 4-bit, 3-bit, 그리고 2-bit까지의 다양한 양자화된 텐서 타입을 지원합니다.
ggerganov - Overview
I like big .vimrc and I cannot lie. ggerganov has 71 repositories available. Follow their code on GitHub.
github.com
오늘 도전할 모델은 바로 LogicKor에서 우수한 점수를 자랑하는 Varco 입니다. LogicKor는 한국어 언어모델의 사고력을 측정하기위해 구성된 다양한 분야의 멀티턴 벤치마크사이트입니다. Varco는 24년 10월 현재 오픈소스 모델 중 두번째로 우수한데, 1등은 llama-3.1 405B모델이라 일반적인 PC환경에서 다룰 수 없을 것 같습니다. 그러니 현재 최고모델!! 한번 시작해보겠습니다~
https://huggingface.co/NCSOFT/Llama-VARCO-8B-Instruct
NCSOFT/Llama-VARCO-8B-Instruct · Hugging Face
Llama-VARCO-8B-Instruct About the Model Llama-VARCO-8B-Instruct is a generative model built with Llama, specifically designed to excel in Korean through additional training. The model uses continual pre-training with both Korean and English datasets to enh
huggingface.co
와우 성공??

네~ 쉽게는 안되지용
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/n/projects/b2636_llama.cpp/convert-hf-to-gguf.py", line 2443, in <module>
main()
File "/home/n/projects/b2636_llama.cpp/convert-hf-to-gguf.py", line 2430, in main
model_instance.set_vocab()
File "/home/n/projects/b2636_llama.cpp/convert-hf-to-gguf.py", line 1218, in set_vocab
self._set_vocab_llama_hf()
File "/home/n/projects/b2636_llama.cpp/convert-hf-to-gguf.py", line 373, in _set_vocab_llama_hf
vocab = LlamaHfVocab(self.dir_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/n/projects/b2636_llama.cpp/convert.py", line 534, in __init__
raise FileNotFoundError('Cannot find Llama BPE tokenizer')
FileNotFoundError: Cannot find Llama BPE tokenizer
변환 중 오류 발생: Command '['python', '/home/n/projects/b2636_llama.cpp/convert-hf-to-gguf.py', 'llama_varco_8b_instruct_GGUF', '--outfile', 'llama_varco_8b_instruct_f16.gguf', '--outtype', 'f16']' returned non-zero exit status 1.다양한 삽질!!
위와 같은 에러들을 잡고 잡으며 계속 헤매다 결국 빌드 b2636 를 찾았습니다~
https://github.com/ggerganov/llama.cpp/releases/tag/b2636
Release b2636 · ggerganov/llama.cpp
llama : add Command R Plus support (#6491) * Add Command R Plus GGUF * Add Command R Plus GGUF * Loading works up to LayerNorm2D * Export new tensors in 1D so they are not quantized. * Fix embedding layer based on Noeda's example * Whitespace * Add line *
github.com

와웃!!! 넵 성공입니다. 올라마로 불러들여 질문을 하니 정체를 밝힙니다^^

Llama_varco_8b_instruct_GGUF 성공!!!
허깅페이스에 올리러 가야쥥 ^,.^
두근두근 첫 업로드 중 입니다!!!

많이들 받아가세요~~
https://huggingface.co/jjjssjs/Llama-VARCO-8B-Instruct-GGUF
jjjssjs/Llama-VARCO-8B-Instruct-GGUF · Hugging Face
Llama-VARCO-8B-Instruct-GGUF Translate the original text Llama-VARCO-8B-Instruct About the Model Llama-VARCO-8B-Instruct is a generative model built with Llama, specifically designed to excel in Korean through additional training. The model uses continual
huggingface.co