Instructions to use llmware/phi-3-ov with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use llmware/phi-3-ov with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="llmware/phi-3-ov", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("llmware/phi-3-ov", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("llmware/phi-3-ov", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use llmware/phi-3-ov with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "llmware/phi-3-ov" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/phi-3-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/llmware/phi-3-ov
- SGLang
How to use llmware/phi-3-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 "llmware/phi-3-ov" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/phi-3-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "llmware/phi-3-ov" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "llmware/phi-3-ov", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use llmware/phi-3-ov with Docker Model Runner:
docker model run hf.co/llmware/phi-3-ov
Upload hash_record_sha256.json
Browse files- hash_record_sha256.json +10 -0
hash_record_sha256.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"openvino_detokenizer.bin": "34f54bcfdecf199ed7333d7748c8e357c9d98b26c0c5800c7e0809e48edd74d3",
|
| 3 |
+
"openvino_detokenizer.xml": "38d8774761f62f252ce3ab95865a47eb86143eef5ae02566472979ce2df9293f",
|
| 4 |
+
"openvino_model.bin": "08b59a6f699207d2bbddc91161ec5dfbae8a88872f30a4f75dee332b10d84510",
|
| 5 |
+
"openvino_model.xml": "43c056febd5c70ce128f0b7d6224d7d1f09f3f6d673b673178aa072f546ad41f",
|
| 6 |
+
"openvino_tokenizer.bin": "46097e0534935f1aec4cbac2c90e565ec51a8513fcd53b841231849403e5e122",
|
| 7 |
+
"openvino_tokenizer.xml": "92d5171e668d2becf7c3add3917c79e7e43399c40bda9412a1957861c72064ce",
|
| 8 |
+
"tokenizer.model": "9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347",
|
| 9 |
+
"time_stamp": "2024-09-24_022453"
|
| 10 |
+
}
|