Text Generation
Transformers
Safetensors
PyTorch
phi
gptq
quantized
causal-lm
phi-2
text-generation-inference
8-bit precision
Instructions to use STiFLeR7/Phi2-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STiFLeR7/Phi2-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="STiFLeR7/Phi2-GPTQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("STiFLeR7/Phi2-GPTQ") model = AutoModelForCausalLM.from_pretrained("STiFLeR7/Phi2-GPTQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use STiFLeR7/Phi2-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "STiFLeR7/Phi2-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "STiFLeR7/Phi2-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/STiFLeR7/Phi2-GPTQ
- SGLang
How to use STiFLeR7/Phi2-GPTQ 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 "STiFLeR7/Phi2-GPTQ" \ --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": "STiFLeR7/Phi2-GPTQ", "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 "STiFLeR7/Phi2-GPTQ" \ --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": "STiFLeR7/Phi2-GPTQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use STiFLeR7/Phi2-GPTQ with Docker Model Runner:
docker model run hf.co/STiFLeR7/Phi2-GPTQ
π§ Phi-2 GPTQ (Quantized)
This repository provides a 4-bit GPTQ quantized version of the Phi-2 model by Microsoft, optimized for efficient inference using gptqmodel.
π Model Details
- Base Model: Microsoft Phi-2
- Quantization: GPTQ (4-bit)
- Quantizer:
GPTQModel - Framework: PyTorch + HuggingFace Transformers
- Device Support: CUDA (GPU)
- License: Apache 2.0
π Features
- β Lightweight: 4-bit quantization significantly reduces memory usage
- β Fast Inference: Ideal for deployment on consumer GPUs
- β
Compatible: Works with
transformers,optimum, andgptqmodel - β CUDA-accelerated: Automatically uses GPU for speed
π Usage
This model is ready-to-use with the Hugging Face transformers library.
π§ͺ Intended Use
- Research and development
- Prototyping generative applications
- Fast inference environments with limited GPU memory
π References
- Microsoft Phi-2: https://huggingface.co/microsoft/phi-2
- GPTQModel: https://github.com/ModelCoud/GPTQModel
- Transformers: https://github.com/huggingface/transformers
βοΈ License
This model is distributed under the Apache License 2.0.
- Downloads last month
- 10
Model tree for STiFLeR7/Phi2-GPTQ
Base model
microsoft/phi-2