Instructions to use teddylee777/Llama-3-Open-Ko-8B-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="teddylee777/Llama-3-Open-Ko-8B-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("teddylee777/Llama-3-Open-Ko-8B-gguf") model = AutoModelForCausalLM.from_pretrained("teddylee777/Llama-3-Open-Ko-8B-gguf", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M # Run inference directly in the terminal: llama cli -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
Use Docker
docker model run hf.co/teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "teddylee777/Llama-3-Open-Ko-8B-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teddylee777/Llama-3-Open-Ko-8B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
- SGLang
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "teddylee777/Llama-3-Open-Ko-8B-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teddylee777/Llama-3-Open-Ko-8B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "teddylee777/Llama-3-Open-Ko-8B-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teddylee777/Llama-3-Open-Ko-8B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with Ollama:
ollama run hf.co/teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with Docker Model Runner:
docker model run hf.co/teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
- Lemonade
How to use teddylee777/Llama-3-Open-Ko-8B-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull teddylee777/Llama-3-Open-Ko-8B-gguf:Q4_K_M
Run and chat with the model
lemonade run user.Llama-3-Open-Ko-8B-gguf-Q4_K_M
List all available models
lemonade list
- Atomic Chat
colab으로 돌리는 방법 여쭤봐도 될까요?
안녕하세요. colab으로 돌리는 중인데
model = Llama.from_pretrained(
repo_id="teddylee777/Llama-3-Open-Ko-8B-gguf",
filename="Llama-3-Open-Ko-8B-Q6_K.gguf",
n_gpu_layers = -1,
chat_format='llama-3'
)
model.verbose=False
system_prompt = "당신은 친절한 어시스턴트로 최선을 다해 답변하세요."
ai = "안녕"
output = llm.create_chat_completion(
messages = [
{"role": "system", "content": system_prompt},
{
"role": "user", "content": ai
}
]
)
이런 기본 코드로 짜서 돌리는데 답변 생성이 안돼서요..다른 기타 등등 코드들을 시도해봤는데 유독 답변이 생성이 안되네요.
혹시 괜찮으시면 조언을 얻고 싶습니다.
감사합니다. 좋은 하루 되세요!
chat_format 에 'llama-3' 대신 model card 에 기입한 템플릿을 활용하여 추론해야 제대로된 답변을 받으실 수 있습니다.
템플릿은 model card 에 넣어놨습니다^^
추가로 대화형 추론을 위해서라면 instruct 모델을 사용하시는 것을 추천 드립니다!
감사합니다!!