erhwenkuo/alpaca-data-gpt4-chinese-zhtw
Viewer • Updated • 52k • 81 • 6
How to use suko/Meta-Llama-3-8B-CHT with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="suko/Meta-Llama-3-8B-CHT") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("suko/Meta-Llama-3-8B-CHT", device_map="auto")How to use suko/Meta-Llama-3-8B-CHT with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M # Run inference directly in the terminal: llama cli -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M # Run inference directly in the terminal: llama cli -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf suko/Meta-Llama-3-8B-CHT:Q4_K_M
docker model run hf.co/suko/Meta-Llama-3-8B-CHT:Q4_K_M
How to use suko/Meta-Llama-3-8B-CHT with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "suko/Meta-Llama-3-8B-CHT"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "suko/Meta-Llama-3-8B-CHT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/suko/Meta-Llama-3-8B-CHT:Q4_K_M
How to use suko/Meta-Llama-3-8B-CHT with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "suko/Meta-Llama-3-8B-CHT" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "suko/Meta-Llama-3-8B-CHT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "suko/Meta-Llama-3-8B-CHT" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "suko/Meta-Llama-3-8B-CHT",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use suko/Meta-Llama-3-8B-CHT with Ollama:
ollama run hf.co/suko/Meta-Llama-3-8B-CHT:Q4_K_M
How to use suko/Meta-Llama-3-8B-CHT with Docker Model Runner:
docker model run hf.co/suko/Meta-Llama-3-8B-CHT:Q4_K_M
How to use suko/Meta-Llama-3-8B-CHT with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull suko/Meta-Llama-3-8B-CHT:Q4_K_M
lemonade run user.Meta-Llama-3-8B-CHT-Q4_K_M
lemonade list
I tried using Ollama to run it, but it became quite delulu.
So for now, I'm sticking with LMStudio :)The performance isn't actually that great, but it's capable of answering some basic questions. Sometimes it just acts really dumb though :(
LLAMA 3.1 can actually output pretty well Chinese, so this repo can be ignored.
4-bit
Base model
meta-llama/Meta-Llama-3-8B