Instructions to use hfl/chinese-llama-2-7b-16k-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use hfl/chinese-llama-2-7b-16k-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="hfl/chinese-llama-2-7b-16k-gguf", filename="ggml-model-f16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use hfl/chinese-llama-2-7b-16k-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf hfl/chinese-llama-2-7b-16k-gguf:F16 # Run inference directly in the terminal: llama-cli -hf hfl/chinese-llama-2-7b-16k-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf hfl/chinese-llama-2-7b-16k-gguf:F16 # Run inference directly in the terminal: llama-cli -hf hfl/chinese-llama-2-7b-16k-gguf:F16
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 hfl/chinese-llama-2-7b-16k-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf hfl/chinese-llama-2-7b-16k-gguf:F16
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 hfl/chinese-llama-2-7b-16k-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf hfl/chinese-llama-2-7b-16k-gguf:F16
Use Docker
docker model run hf.co/hfl/chinese-llama-2-7b-16k-gguf:F16
- LM Studio
- Jan
- Ollama
How to use hfl/chinese-llama-2-7b-16k-gguf with Ollama:
ollama run hf.co/hfl/chinese-llama-2-7b-16k-gguf:F16
- Unsloth Studio new
How to use hfl/chinese-llama-2-7b-16k-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hfl/chinese-llama-2-7b-16k-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hfl/chinese-llama-2-7b-16k-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for hfl/chinese-llama-2-7b-16k-gguf to start chatting
- Docker Model Runner
How to use hfl/chinese-llama-2-7b-16k-gguf with Docker Model Runner:
docker model run hf.co/hfl/chinese-llama-2-7b-16k-gguf:F16
- Lemonade
How to use hfl/chinese-llama-2-7b-16k-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull hfl/chinese-llama-2-7b-16k-gguf:F16
Run and chat with the model
lemonade run user.chinese-llama-2-7b-16k-gguf-F16
List all available models
lemonade list
Chinese-LLaMA-2-7B-16K-GGUF
This repository contains the GGUF-v3 models (llama.cpp compatible) for Chinese-LLaMA-2-7B-16K.
Performance
Metric: PPL, lower is better
| Quant | original | imatrix (-im) |
|---|---|---|
| Q2_K | 11.5580 +/- 0.23848 | 12.3757 +/- 0.26048 |
| Q3_K | 9.8263 +/- 0.20663 | 9.7124 +/- 0.20569 |
| Q4_0 | 9.6558 +/- 0.20657 | - |
| Q4_K | 9.5590 +/- 0.20460 | 9.4945 +/- 0.20337 |
| Q5_0 | 9.2767 +/- 0.19835 | - |
| Q5_K | 9.4303 +/- 0.20305 | 9.4275 +/- 0.20291 |
| Q6_K | 9.4046 +/- 0.20272 | 9.4106 +/- 0.20284 |
| Q8_0 | 9.2145 +/- 0.19943 | - |
| F16 | 9.4045 +/- 0.20289 | - |
The model with -im suffix is generated with important matrix, which has generally better performance (not always though).
Others
For Hugging Face version, please see: https://huggingface.co/hfl/chinese-llama-2-7b-16k
Please refer to https://github.com/ymcui/Chinese-LLaMA-Alpaca-2/ for more details.
- Downloads last month
- 105
2-bit
4-bit
5-bit
6-bit
8-bit
16-bit