Huggingface 모델을 Ollama로 구동해보자
모델 준비
테스트 모델
MLP-KTLim/llama-3-Korean-Bllossom-8B at main
We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Huggingface 모델 다운로드
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/MLP-KTLim/llama-3-Korean-Bllossom-8B
git lfs install
git lfs pull
Satetensors To gguf
How to convert HF (safetensors) 🤗 model to gguf
A quick guide with code

GitHub - ggerganov/llama.cpp: LLM inference in C/C++
LLM inference in C/C++. Contribute to ggerganov/llama.cpp development by creating an account on GitHub.
Llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
python 환경 구성
python3 -m venv gguf
source gguf/bin/activate
pip install -r llama.cpp/requirements.txt
Satetensors To gguf
python3 llama.cpp/convert_hf_to_gguf.py \
MLP-KTLim/llama-3-Korean-Bllossom-8B \
--outfile MLP-KTLim/llama-3-Korean-Bllossom-8B-gguf/model.gguf \
--outtype f16
- convert_hf_to_gguf.py (v)
- convert_hf_to_gguf_update.py
- convert_llama_ggml_to_gguf.py
- convert_llama_ggml_to_gguf.py
Ollama 모델 추가
Modelfile 준비
FROM model.gguf
TEMPLATE """{{- if .System }}
<s>{{ .System }}</s>
{{- end }}
<s>Human:
{{ .Prompt }}</s>
<s>Assistant:
"""
SYSTEM """A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."""
PARAMETER stop <s>
PARAMETER stop </s>
모델 생성
ollama create llama-3-Korean-Bllossom-8B -f Modelfile
모델 실행
ollama run llama-3-Korean-Bllossom-8B
root@ollama:~/MLP-KTLim/llama-3-Korean-Bllossom-8B-gguf# ollama run llama-3-Korean-Bllossom-8B
>>> 안녕
안녕하세요! 어떻게 도와드릴까요?
>>> LLM이 뭐야?
Large Language Model(대규모 언어 모델)이라고 불리는 LLM은 인공지능(AI) 기술을 기반으로 한 컴퓨터 프로그램입니다
. 이 모델은 대량의 텍스트 데이터를 학습하여 언어 이해와 생성 능력을 발휘합니다. 예를 들어, 질문에 답하거나 글을
쓰는 등의 다양한 작업을 수행할 수 있습니다.
>>> LLM을 통해 인간의 의식을 구현할 수 있을까?
현재로서는 LLM이 인간과 동일한 자율적 의식이나 인지 능력을 갖추고 있지는 않습니다. 그러나 AI 연구는 매우 빠르게
발전하고 있으며, 특정한 과제나 상황에서 사람과 유사한 성능을 내는 모델들을 개발하는 데 성공하고 있습니다. 예를
들어, 일부 LLM은 자연어 이해와 생성에 있어서 매우 고도로 정교해져 있어 사람처럼 보이는 대화나 글을 작성할 수
있습니다. 하지만 여전히 AI의 '인간like' 자율적 의식이나 감정, 직관 등을 완전히 모방하는 것은 현재 기술적으로 불
가능합니다.
>>> 어떤 부분에서 부족한거야??
LLM이 아직 인간과 달리 다음과 같은 몇 가지 부분에서 부족함을 보입니다:
1. **추론 능력**: LLM은 주어진 정보를 기반으로 새로운 결론을 도출하는 데 한계가 있습니다.
2. **자율성**: AI는 외부의 명령이나 데이터에 따라 작동하며, 자율적으로 의사결정을 내리는 것은 아직 어렵습니다
.
3. **감정 및 사회적 이해**: 감정적 반응이나 복잡한 사회적 상황을 완벽하게 이해하고 대처하는 데에는 여전히 한계
가 있습니다.
4. **생각과 창의성**: 창작적인 아이디어나 새로운 생각을 독자적으로 제시하는 능력은 인간에만 있을 정도로 발전하
지 않았습니다.
이러한 부분들이 AI의 진화를 위한 현재 과제입니다. 연구와 기술의 발전으로 이러한 한계를 gradually 극복하고 있습
니다.