Run this model with HF Jobs
Run OpenVINO/phi-2-fp16-ov on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenVINO/phi-2-fp16-ov. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenVINO/phi-2-fp16-ov on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OpenVINO/phi-2-fp16-ov. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OpenVINO/phi-2-fp16-ov. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenVINO/phi-2-fp16-ov with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenVINO/phi-2-fp16-ov with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenVINO/phi-2-fp16-ov")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenVINO/phi-2-fp16-ov") model = AutoModelForCausalLM.from_pretrained("OpenVINO/phi-2-fp16-ov", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenVINO/phi-2-fp16-ov with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenVINO/phi-2-fp16-ov" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenVINO/phi-2-fp16-ov", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenVINO/phi-2-fp16-ov
- SGLang
How to use OpenVINO/phi-2-fp16-ov 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 "OpenVINO/phi-2-fp16-ov" \ --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": "OpenVINO/phi-2-fp16-ov", "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 "OpenVINO/phi-2-fp16-ov" \ --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": "OpenVINO/phi-2-fp16-ov", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenVINO/phi-2-fp16-ov with Docker Model Runner:
docker model run hf.co/OpenVINO/phi-2-fp16-ov
add genai usage instructions
Browse files20 unmodified lines2122232425262720 unmodified lines48495051525320 unmodified lines* OpenVINO version 2024.1.0 and higher* Optimum Intel 1.16.0 and higher## Running Model Inference1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:20 unmodified linesFor more examples and possible optimizations, refer to the [OpenVINO Large Language Model Inference Guide](https://docs.openvino.ai/2024/learn-openvino/llm_inference_guide.html).## LimitationsCheck the original model card for [limitations](https://huggingface.co/microsoft/phi-2#limitations-of-phi-2).20 unmodified lines2122232425262720 unmodified lines4849505152535455565758596061626364656667686970717273747576777879808182838420 unmodified lines* OpenVINO version 2024.1.0 and higher* Optimum Intel 1.16.0 and higher## Running Model Inference with [Optimum Intel](https://huggingface.co/docs/optimum/intel/index)1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:20 unmodified linesFor more examples and possible optimizations, refer to the [OpenVINO Large Language Model Inference Guide](https://docs.openvino.ai/2024/learn-openvino/llm_inference_guide.html).## Running Model Inference with [OpenVINO GenAI](https://github.com/openvinotoolkit/openvino.genai)1. Install packages required for using OpenVINO GenAI.```pip install openvino-genai huggingface_hub```2. Download model from HuggingFace Hub```import huggingface_hub as hf_hubmodel_id = "OpenVINO/phi-2-fp16-ov"model_path = "phi-2-fp16-ov"hf_hub.snapshot_download(model_id, local_dir=model_path)```3. Run model inference:```import openvino_genai as ov_genaidevice = "CPU"pipe = ov_genai.LLMPipeline(model_path, device)print(pipe.generate("What is OpenVINO?"))```More GenAI usage examples can be found in OpenVINO GenAI library [docs](https://github.com/openvinotoolkit/openvino.genai/blob/master/src/README.md) and [samples](https://github.com/openvinotoolkit/openvino.genai?tab=readme-ov-file#openvino-genai-samples)## LimitationsCheck the original model card for [limitations](https://huggingface.co/microsoft/phi-2#limitations-of-phi-2).
README.md+32-1