Text Generation
Transformers
Safetensors
phi
text-generation-inference
4-bit precision
intel/auto-round
Instructions to use INC4AI/phi-2-int4-inc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use INC4AI/phi-2-int4-inc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="INC4AI/phi-2-int4-inc")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("INC4AI/phi-2-int4-inc") model = AutoModelForCausalLM.from_pretrained("INC4AI/phi-2-int4-inc", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use INC4AI/phi-2-int4-inc with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "INC4AI/phi-2-int4-inc" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "INC4AI/phi-2-int4-inc", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/INC4AI/phi-2-int4-inc
- SGLang
How to use INC4AI/phi-2-int4-inc 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 "INC4AI/phi-2-int4-inc" \ --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": "INC4AI/phi-2-int4-inc", "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 "INC4AI/phi-2-int4-inc" \ --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": "INC4AI/phi-2-int4-inc", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use INC4AI/phi-2-int4-inc with Docker Model Runner:
docker model run hf.co/INC4AI/phi-2-int4-inc
Commit History
-
Update README.md
Verified signaturecaca832 -
Update README.md
Verified signature88ef27a -
Update README.md
Verified signature702dc57 -
Update README.md
Verified signature3efe8d3 -
Update README.md
Verified signature0b780a4 -
Update README.md
Verified signature8c36421
-
upload autoround format
Signed-off-by: n1ck-guo <heng.guo@intel.com>9ef095a -
Update README.md
Verified signature8190bfa -
upload auto_gptq format
Signed-off-by: n1ck-guo <heng.guo@intel.com>5973e3a
-
Update README.md
Verified signature26058cf
-
Update README.md
Verified signature4be85d7
-
Update README.md
Verified signatureadd itrex inference egf7c0764
-
Update README.md
Verified signatureb275332 -
Update README.md
Verified signatureb7b2aed -
add readme
Signed-off-by: wenhuach <wenhuach87@gmail.com>3227d1c -
update readme
Signed-off-by: wenhuach <wenhuach87@gmail.com>2ae134d -
replace with sym quantization as there is a large accuracy drop due to kernel issue
Signed-off-by: wenhuach <wenhuach87@gmail.com>f201b74
-
Update README.md
Verified signature8cc1fac -
Update README.md
Verified signaturee700da8 -
Update README.md
Verified signature60f2919
-
update script following enable_quanted_input argument change
Verified signature559c322
-
Update README.md
Verified signaturea71e3b7
-
Update README.md
Verified signaturef01205c
-
Update README.md
Verified signature5b294fa -
Update README.md
Verified signatured50a9b0 -
Update README.md
Verified signature1337af8 -
tiny change
Signed-off-by: wenhuach <wenhuach87@gmail.com>b5cf4ad -
add readme
Signed-off-by: wenhuach <wenhuach87@gmail.com>4ea3d16
-
first commit
Signed-off-by: wenhuach <wenhuach87@gmail.com>3516d2e -
initial commit
Verified signatured5e1fda