Instructions to use Dracones/WizardLM-2-8x22B_exl2_2.25bpw with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dracones/WizardLM-2-8x22B_exl2_2.25bpw with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dracones/WizardLM-2-8x22B_exl2_2.25bpw")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Dracones/WizardLM-2-8x22B_exl2_2.25bpw") model = AutoModelForCausalLM.from_pretrained("Dracones/WizardLM-2-8x22B_exl2_2.25bpw", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dracones/WizardLM-2-8x22B_exl2_2.25bpw with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dracones/WizardLM-2-8x22B_exl2_2.25bpw" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dracones/WizardLM-2-8x22B_exl2_2.25bpw", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Dracones/WizardLM-2-8x22B_exl2_2.25bpw
- SGLang
How to use Dracones/WizardLM-2-8x22B_exl2_2.25bpw with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Dracones/WizardLM-2-8x22B_exl2_2.25bpw" \ --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": "Dracones/WizardLM-2-8x22B_exl2_2.25bpw", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "Dracones/WizardLM-2-8x22B_exl2_2.25bpw" \ --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": "Dracones/WizardLM-2-8x22B_exl2_2.25bpw", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Dracones/WizardLM-2-8x22B_exl2_2.25bpw with Docker Model Runner:
docker model run hf.co/Dracones/WizardLM-2-8x22B_exl2_2.25bpw
|
Download README.md from Dracones/WizardLM-2-8x22B_exl2_2.25bpw: direct link, hf CLI and curl.
- Browser
- Download file 3.52 kB
-
https://huggingface.co/Dracones/WizardLM-2-8x22B_exl2_2.25bpw/resolve/main/README.md
- Command line
-
hf download hf://Dracones/WizardLM-2-8x22B_exl2_2.25bpw/README.md
-
curl -L -o README.md https://huggingface.co/Dracones/WizardLM-2-8x22B_exl2_2.25bpw/resolve/main/README.md
3.52 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| base_model: microsoft/WizardLM-2-8x22B | |
| tags: | |
| - exl2 | |
| # WizardLM-2-8x22B - EXL2 2.25bpw | |
| This is a 2.25bpw EXL2 quant of [microsoft/WizardLM-2-8x22B](https://huggingface.co/microsoft/WizardLM-2-8x22B) | |
| Details about the model can be found at the above model page. | |
| ## EXL2 Version | |
| These quants were made with exllamav2 version 0.0.18. Quants made on this version of EXL2 may not work on older versions of the exllamav2 library. | |
| If you have problems loading these models, please update Text Generation WebUI to the latest version. | |
| ## Perplexity Scoring | |
| Below are the perplexity scores for the EXL2 models. A lower score is better. | |
| | Quant Level | Perplexity Score | | |
| |-------------|------------------| | |
| | 7.0 | 4.5859 | | |
| | 6.0 | 4.6252 | | |
| | 5.5 | 4.6493 | | |
| | 5.0 | 4.6937 | | |
| | 4.5 | 4.8029 | | |
| | 4.0 | 4.9372 | | |
| | 3.5 | 5.1336 | | |
| | 3.25 | 5.3636 | | |
| | 3.0 | 5.5468 | | |
| | 2.75 | 5.8255 | | |
| | 2.5 | 6.3362 | | |
| | 2.25 | 7.7763 | | |
| ### Perplexity Script | |
| This was the script used for perplexity testing. | |
| ```bash | |
| #!/bin/bash | |
| # Activate the conda environment | |
| source ~/miniconda3/etc/profile.d/conda.sh | |
| conda activate exllamav2 | |
| DATA_SET=/root/wikitext/wikitext-2-v1.parquet | |
| # Set the model name and bit size | |
| MODEL_NAME="WizardLM-2-8x22B" | |
| BIT_PRECISIONS=(6.0 5.5 5.0 4.5 4.0 3.5 3.25 3.0 2.75 2.5 2.25) | |
| # Print the markdown table header | |
| echo "| Quant Level | Perplexity Score |" | |
| echo "|-------------|------------------|" | |
| for BIT_PRECISION in "${BIT_PRECISIONS[@]}" | |
| do | |
| LOCAL_FOLDER="/root/models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw" | |
| REMOTE_FOLDER="Dracones/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw" | |
| if [ ! -d "$LOCAL_FOLDER" ]; then | |
| huggingface-cli download --local-dir-use-symlinks=False --local-dir "${LOCAL_FOLDER}" "${REMOTE_FOLDER}" >> /root/download.log 2>&1 | |
| fi | |
| output=$(python test_inference.py -m "$LOCAL_FOLDER" -gs 40,40,40,40 -ed "$DATA_SET") | |
| score=$(echo "$output" | grep -oP 'Evaluation perplexity: \K[\d.]+') | |
| echo "| $BIT_PRECISION | $score |" | |
| # rm -rf "${LOCAL_FOLDER}" | |
| done | |
| ``` | |
| ## Quant Details | |
| This is the script used for quantization. | |
| ```bash | |
| #!/bin/bash | |
| # Activate the conda environment | |
| source ~/miniconda3/etc/profile.d/conda.sh | |
| conda activate exllamav2 | |
| # Set the model name and bit size | |
| MODEL_NAME="WizardLM-2-8x22B" | |
| # Define variables | |
| MODEL_DIR="/mnt/storage/models/$MODEL_NAME" | |
| OUTPUT_DIR="exl2_$MODEL_NAME" | |
| MEASUREMENT_FILE="measurements/$MODEL_NAME.json" | |
| # Create the measurement file if needed | |
| if [ ! -f "$MEASUREMENT_FILE" ]; then | |
| echo "Creating $MEASUREMENT_FILE" | |
| # Create directories | |
| if [ -d "$OUTPUT_DIR" ]; then | |
| rm -r "$OUTPUT_DIR" | |
| fi | |
| mkdir "$OUTPUT_DIR" | |
| python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -om $MEASUREMENT_FILE | |
| fi | |
| # Choose one of the below. Either create a single quant for testing or a batch of them. | |
| # BIT_PRECISIONS=(2.25) | |
| BIT_PRECISIONS=(5.0 4.5 4.0 3.5 3.0 2.75 2.5 2.25) | |
| for BIT_PRECISION in "${BIT_PRECISIONS[@]}" | |
| do | |
| CONVERTED_FOLDER="models/${MODEL_NAME}_exl2_${BIT_PRECISION}bpw" | |
| # If it doesn't already exist, make the quant | |
| if [ ! -d "$CONVERTED_FOLDER" ]; then | |
| echo "Creating $CONVERTED_FOLDER" | |
| # Create directories | |
| if [ -d "$OUTPUT_DIR" ]; then | |
| rm -r "$OUTPUT_DIR" | |
| fi | |
| mkdir "$OUTPUT_DIR" | |
| mkdir "$CONVERTED_FOLDER" | |
| # Run conversion commands | |
| python convert.py -i $MODEL_DIR -o $OUTPUT_DIR -nr -m $MEASUREMENT_FILE -b $BIT_PRECISION -cf $CONVERTED_FOLDER | |
| fi | |
| done | |
| ``` | |