Instructions to use HelloSun/openPangu-R-7B-Diffusion-Q4KM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use HelloSun/openPangu-R-7B-Diffusion-Q4KM 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 HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M # Run inference directly in the terminal: llama cli -hf HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M # Run inference directly in the terminal: llama cli -hf HelloSun/openPangu-R-7B-Diffusion-Q4KM: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 HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf HelloSun/openPangu-R-7B-Diffusion-Q4KM: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 HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
Use Docker
docker model run hf.co/HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use HelloSun/openPangu-R-7B-Diffusion-Q4KM with Ollama:
ollama run hf.co/HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use HelloSun/openPangu-R-7B-Diffusion-Q4KM with Docker Model Runner:
docker model run hf.co/HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
- Lemonade
How to use HelloSun/openPangu-R-7B-Diffusion-Q4KM with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull HelloSun/openPangu-R-7B-Diffusion-Q4KM:Q4_K_M
Run and chat with the model
lemonade run user.openPangu-R-7B-Diffusion-Q4KM-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload build_llamacpp_pangu_diffusion.sh with huggingface_hub
Browse files
build_llamacpp_pangu_diffusion.sh
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
#
|
| 3 |
+
# One-click build of llama.cpp with openPangu-R-7B-Diffusion support.
|
| 4 |
+
#
|
| 5 |
+
# ./build_llamacpp_pangu_diffusion.sh
|
| 6 |
+
#
|
| 7 |
+
# It will:
|
| 8 |
+
# 1. clone llama.cpp at the pinned release tag
|
| 9 |
+
# 2. download and apply the openPangu-R-Diffusion patch
|
| 10 |
+
# 3. build llama-diffusion-cli / llama-cli / llama-quantize
|
| 11 |
+
#
|
| 12 |
+
# Requirements: git, cmake >= 3.14, a C/C++ toolchain, and (optionally) an NVIDIA GPU.
|
| 13 |
+
#
|
| 14 |
+
set -euo pipefail
|
| 15 |
+
|
| 16 |
+
LLAMA_TAG="b11719"
|
| 17 |
+
PATCH_URL="https://huggingface.co/HelloSun/openPangu-R-7B-Diffusion-Q4KM/resolve/main/pangu-diffusion-llamacpp.patch"
|
| 18 |
+
WORKDIR="${WORKDIR:-$PWD/pangu-diffusion-build}"
|
| 19 |
+
|
| 20 |
+
mkdir -p "$WORKDIR"
|
| 21 |
+
cd "$WORKDIR"
|
| 22 |
+
|
| 23 |
+
if [ ! -d llama.cpp ]; then
|
| 24 |
+
echo ">>> cloning llama.cpp ($LLAMA_TAG) ..."
|
| 25 |
+
git clone --depth 1 --branch "$LLAMA_TAG" https://github.com/ggml-org/llama.cpp.git
|
| 26 |
+
fi
|
| 27 |
+
|
| 28 |
+
cd llama.cpp
|
| 29 |
+
git checkout -- . 2>/dev/null || true
|
| 30 |
+
|
| 31 |
+
echo ">>> downloading patch ..."
|
| 32 |
+
curl -L --fail -o pangu-diffusion-llamacpp.patch "$PATCH_URL"
|
| 33 |
+
|
| 34 |
+
echo ">>> applying patch ..."
|
| 35 |
+
git apply pangu-diffusion-llamacpp.patch
|
| 36 |
+
|
| 37 |
+
echo ">>> configuring ..."
|
| 38 |
+
if command -v nvcc >/dev/null 2>&1; then
|
| 39 |
+
cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=OFF
|
| 40 |
+
else
|
| 41 |
+
cmake -B build -DGGML_NATIVE=ON -DLLAMA_CURL=OFF
|
| 42 |
+
fi
|
| 43 |
+
|
| 44 |
+
echo ">>> building ..."
|
| 45 |
+
cmake --build build --config Release -j"$(nproc)" --target llama-diffusion-cli llama-cli llama-quantize
|
| 46 |
+
|
| 47 |
+
echo
|
| 48 |
+
echo ">>> done. binaries:"
|
| 49 |
+
echo " $WORKDIR/llama.cpp/build/bin/llama-diffusion-cli"
|
| 50 |
+
echo " $WORKDIR/llama.cpp/build/bin/llama-cli"
|