Instructions to use mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ") model = AutoModelForCausalLM.from_pretrained("mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ
- SGLang
How to use mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ 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 "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ" \ --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": "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ", "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 "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ" \ --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": "mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ with Docker Model Runner:
docker model run hf.co/mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ
Llama-2-70b-hf-2bit_g16_s128-HQQ {Deprecated}
This is a version of the LLama-2-70B-hf model quantized to 2-bit via Half-Quadratic Quantization (HQQ): https://mobiusml.github.io/hqq_blog/
This model outperforms an fp16 LLama-2-13B (perplexity 4.13 vs. 4.63) for a comparable ~26GB size.
Warning: this model is deprecated, it requires an older version of hqq.
To run the model, install the HQQ library:
#This model is deprecated and requires older versions
pip install hqq==0.1.8
pip install transformers==4.46.0
and use it as follows:
model_id = 'mobiuslabsgmbh/Llama-2-70b-hf-2bit_g16_s128-HQQ'
from hqq.engine.hf import HQQModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = HQQModelForCausalLM.from_quantized(model_id)
Limitations:
-Only supports single GPU runtime.
-Not compatible with HuggingFace's PEFT.
- Downloads last month
- 19