Instructions to use compilade/quant-tests with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use compilade/quant-tests with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="compilade/quant-tests", filename="TriLM_1.5B_Unpacked-TQ1_0-F16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- 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
- Atomic Chat new
- 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
Format bench-TriLMs.py with black
Browse files- bench-TriLMs.py +10 -6
bench-TriLMs.py
CHANGED
|
@@ -117,7 +117,7 @@ def llama_bench(
|
|
| 117 |
logger.debug(result.stderr.decode(errors="ignore"))
|
| 118 |
if result.returncode != 0 or len(result.stdout) == 0:
|
| 119 |
logger.error("Failed to run %s", " ".join(command))
|
| 120 |
-
break
|
| 121 |
|
| 122 |
new_output = json.loads(result.stdout)
|
| 123 |
logger.info(json.dumps(new_output, indent=4))
|
|
@@ -171,7 +171,9 @@ def parse_args(args: Sequence[str]):
|
|
| 171 |
default=Path(os.path.curdir) / "result.json",
|
| 172 |
help="Path of the benchmark results to be written",
|
| 173 |
)
|
| 174 |
-
parser.add_argument(
|
|
|
|
|
|
|
| 175 |
return parser.parse_args(args[1:])
|
| 176 |
|
| 177 |
|
|
@@ -216,13 +218,15 @@ if __name__ == "__main__":
|
|
| 216 |
|
| 217 |
if shutil.which("lscpu") is not None:
|
| 218 |
logger.info("Getting CPU info")
|
| 219 |
-
final_result["cpuinfo"] = subprocess.run(
|
| 220 |
-
|
| 221 |
-
)
|
| 222 |
|
| 223 |
if args.gpu and shutil.which("nvidia-smi") is not None:
|
| 224 |
logger.info("Getting NVIDIA GPU info")
|
| 225 |
-
final_result["gpuinfo"] = subprocess.run(
|
|
|
|
|
|
|
| 226 |
|
| 227 |
logger.info("Writing output to: %s", output_file)
|
| 228 |
logger.debug("Final results: %s", json.dumps(final_result, indent=4))
|
|
|
|
| 117 |
logger.debug(result.stderr.decode(errors="ignore"))
|
| 118 |
if result.returncode != 0 or len(result.stdout) == 0:
|
| 119 |
logger.error("Failed to run %s", " ".join(command))
|
| 120 |
+
break
|
| 121 |
|
| 122 |
new_output = json.loads(result.stdout)
|
| 123 |
logger.info(json.dumps(new_output, indent=4))
|
|
|
|
| 171 |
default=Path(os.path.curdir) / "result.json",
|
| 172 |
help="Path of the benchmark results to be written",
|
| 173 |
)
|
| 174 |
+
parser.add_argument(
|
| 175 |
+
"--force", action="store_true", help="Overwrite the result file without asking"
|
| 176 |
+
)
|
| 177 |
return parser.parse_args(args[1:])
|
| 178 |
|
| 179 |
|
|
|
|
| 218 |
|
| 219 |
if shutil.which("lscpu") is not None:
|
| 220 |
logger.info("Getting CPU info")
|
| 221 |
+
final_result["cpuinfo"] = subprocess.run(
|
| 222 |
+
["lscpu"], capture_output=True
|
| 223 |
+
).stdout.decode(encoding="utf-8")
|
| 224 |
|
| 225 |
if args.gpu and shutil.which("nvidia-smi") is not None:
|
| 226 |
logger.info("Getting NVIDIA GPU info")
|
| 227 |
+
final_result["gpuinfo"] = subprocess.run(
|
| 228 |
+
["nvidia-smi", "-q"], capture_output=True
|
| 229 |
+
).stdout.decode(encoding="utf-8")
|
| 230 |
|
| 231 |
logger.info("Writing output to: %s", output_file)
|
| 232 |
logger.debug("Final results: %s", json.dumps(final_result, indent=4))
|