Instructions to use echarlaix/tiny-random-PhiForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use echarlaix/tiny-random-PhiForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="echarlaix/tiny-random-PhiForCausalLM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("echarlaix/tiny-random-PhiForCausalLM") model = AutoModelForCausalLM.from_pretrained("echarlaix/tiny-random-PhiForCausalLM") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use echarlaix/tiny-random-PhiForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "echarlaix/tiny-random-PhiForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "echarlaix/tiny-random-PhiForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/echarlaix/tiny-random-PhiForCausalLM
- SGLang
How to use echarlaix/tiny-random-PhiForCausalLM 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 "echarlaix/tiny-random-PhiForCausalLM" \ --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": "echarlaix/tiny-random-PhiForCausalLM", "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 "echarlaix/tiny-random-PhiForCausalLM" \ --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": "echarlaix/tiny-random-PhiForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use echarlaix/tiny-random-PhiForCausalLM with Docker Model Runner:
docker model run hf.co/echarlaix/tiny-random-PhiForCausalLM
Adding OpenVINO file of this model (#1)
Browse files- Adding OpenVINO file of this model (f5a0a2dc743c997c62454e9e1cde32930cace2c9)
- openvino_model.bin +3 -0
- openvino_model.xml +0 -0
openvino_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20fd0bbe41c621f8e9fbcc7c75592e9b431d39ab38604c9c9c891e2b12c2d4a9
|
| 3 |
+
size 330488
|
openvino_model.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|