Instructions to use compilade/quant-tests 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 compilade/quant-tests 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 compilade/quant-tests:F16 # Run inference directly in the terminal: llama cli -hf compilade/quant-tests:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf compilade/quant-tests:F16 # Run inference directly in the terminal: llama cli -hf compilade/quant-tests: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 compilade/quant-tests:F16 # Run inference directly in the terminal: ./llama-cli -hf compilade/quant-tests: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 compilade/quant-tests:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf compilade/quant-tests:F16
Use Docker
docker model run hf.co/compilade/quant-tests:F16
- LM Studio
- Jan
- Ollama
How to use compilade/quant-tests with Ollama:
ollama run hf.co/compilade/quant-tests:F16
- Unsloth Studio
How to use compilade/quant-tests 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 compilade/quant-tests 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 compilade/quant-tests to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for compilade/quant-tests to start chatting
- Docker Model Runner
How to use compilade/quant-tests with Docker Model Runner:
docker model run hf.co/compilade/quant-tests:F16
- Lemonade
How to use compilade/quant-tests with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull compilade/quant-tests:F16
Run and chat with the model
lemonade run user.quant-tests-F16
List all available models
lemonade list
- Atomic Chat
Add some error handling to the Python-based bench script
Browse files- bench-TriLMs.py +8 -2
bench-TriLMs.py
CHANGED
|
@@ -58,7 +58,7 @@ def quantize(types: Sequence[str] = ALL_TYPES, sizes: Sequence[str] = MODEL_SIZE
|
|
| 58 |
source = MODEL_DIR / f"TriLM_{size}B_Unpacked-TQ1_0-F16.gguf"
|
| 59 |
for ty in types:
|
| 60 |
target = MODEL_DIR / f"TriLM_{size}B_Unpacked-{ty}.gguf"
|
| 61 |
-
if not target.exists():
|
| 62 |
command = shlex.join(
|
| 63 |
(
|
| 64 |
str(LLAMA_CPP_PATH / "build" / "bin" / "llama-quantize"),
|
|
@@ -69,7 +69,10 @@ def quantize(types: Sequence[str] = ALL_TYPES, sizes: Sequence[str] = MODEL_SIZE
|
|
| 69 |
)
|
| 70 |
)
|
| 71 |
logger.info("Running: %s", command)
|
| 72 |
-
os.system(command)
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
|
| 75 |
def llama_bench(
|
|
@@ -107,6 +110,9 @@ def llama_bench(
|
|
| 107 |
logger.info("Running: %s", " ".join(command))
|
| 108 |
result = subprocess.run(command, capture_output=True)
|
| 109 |
logger.debug(result.stderr.decode())
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
new_output = json.loads(result.stdout)
|
| 112 |
logger.info(json.dumps(new_output, indent=4))
|
|
|
|
| 58 |
source = MODEL_DIR / f"TriLM_{size}B_Unpacked-TQ1_0-F16.gguf"
|
| 59 |
for ty in types:
|
| 60 |
target = MODEL_DIR / f"TriLM_{size}B_Unpacked-{ty}.gguf"
|
| 61 |
+
if not target.exists() or target.is_file() and target.stat().st_size == 0:
|
| 62 |
command = shlex.join(
|
| 63 |
(
|
| 64 |
str(LLAMA_CPP_PATH / "build" / "bin" / "llama-quantize"),
|
|
|
|
| 69 |
)
|
| 70 |
)
|
| 71 |
logger.info("Running: %s", command)
|
| 72 |
+
ret = os.system(command)
|
| 73 |
+
if ret != 0:
|
| 74 |
+
logger.error("Failed to quantize to %s", target)
|
| 75 |
+
# Should it still continue?
|
| 76 |
|
| 77 |
|
| 78 |
def llama_bench(
|
|
|
|
| 110 |
logger.info("Running: %s", " ".join(command))
|
| 111 |
result = subprocess.run(command, capture_output=True)
|
| 112 |
logger.debug(result.stderr.decode())
|
| 113 |
+
if result.returncode != 0:
|
| 114 |
+
logger.error("Failed to run %s", " ".join(command))
|
| 115 |
+
break;
|
| 116 |
|
| 117 |
new_output = json.loads(result.stdout)
|
| 118 |
logger.info(json.dumps(new_output, indent=4))
|