Instructions to use Intel/phi-2-ov-quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Intel/phi-2-ov-quantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Intel/phi-2-ov-quantized")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Intel/phi-2-ov-quantized") model = AutoModelForCausalLM.from_pretrained("Intel/phi-2-ov-quantized") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Intel/phi-2-ov-quantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Intel/phi-2-ov-quantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Intel/phi-2-ov-quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Intel/phi-2-ov-quantized
- SGLang
How to use Intel/phi-2-ov-quantized 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 "Intel/phi-2-ov-quantized" \ --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": "Intel/phi-2-ov-quantized", "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 "Intel/phi-2-ov-quantized" \ --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": "Intel/phi-2-ov-quantized", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Intel/phi-2-ov-quantized with Docker Model Runner:
docker model run hf.co/Intel/phi-2-ov-quantized
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,7 +10,6 @@ tags:
|
|
| 10 |
# Phi-2-OV-Quantized Model Card
|
| 11 |
|
| 12 |
The original source of this model is: [microsoft/phi-2](https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base)
|
| 13 |
-
This Phi-2 model is a transformer model with 2.7 billion parameters.
|
| 14 |
This model is optimized and converted to OpenVino Intermediate Representation (IR) format using Optimum-cli.
|
| 15 |
The model has been exported from Int4 while exporting this model from Huggingface.
|
| 16 |
|
|
@@ -21,9 +20,9 @@ Intended to be used with:
|
|
| 21 |
|
| 22 |
- **Model type:** a Transformer-based model with next-word prediction objective
|
| 23 |
- **Language(s):** English
|
| 24 |
-
- **License:** This model is licensed under the MIT License
|
| 25 |
-
- **Model Summary:**
|
| 26 |
-
- **Resources for more information:** [
|
| 27 |
|
| 28 |
|
| 29 |
# Intended Uses
|
|
|
|
| 10 |
# Phi-2-OV-Quantized Model Card
|
| 11 |
|
| 12 |
The original source of this model is: [microsoft/phi-2](https://huggingface.co/deepseek-ai/deepseek-coder-1.3b-base)
|
|
|
|
| 13 |
This model is optimized and converted to OpenVino Intermediate Representation (IR) format using Optimum-cli.
|
| 14 |
The model has been exported from Int4 while exporting this model from Huggingface.
|
| 15 |
|
|
|
|
| 20 |
|
| 21 |
- **Model type:** a Transformer-based model with next-word prediction objective
|
| 22 |
- **Language(s):** English
|
| 23 |
+
- **License:** This model is licensed under the [MIT License](https://huggingface.co/microsoft/phi-2/resolve/main/LICENSE)
|
| 24 |
+
- **Model Summary:** Phi-2 is a Transformer with 2.7 billion parameters. It was trained using the same data sources as Phi-1.5, augmented with a new data source that consists of various NLP synthetic texts and filtered websites (for safety and educational value). When assessed against benchmarks testing common sense, language understanding, and logical reasoning, Phi-2 showcased a nearly state-of-the-art performance among models with less than 13 billion parameters.
|
| 25 |
+
- **Resources for more information:** [microsoft/phi-2](https://huggingface.co/microsoft/phi-2)
|
| 26 |
|
| 27 |
|
| 28 |
# Intended Uses
|