Instructions to use rhysjones/phi-2-orange with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rhysjones/phi-2-orange with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rhysjones/phi-2-orange", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("rhysjones/phi-2-orange", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use rhysjones/phi-2-orange with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rhysjones/phi-2-orange" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rhysjones/phi-2-orange", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rhysjones/phi-2-orange
- SGLang
How to use rhysjones/phi-2-orange 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 "rhysjones/phi-2-orange" \ --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": "rhysjones/phi-2-orange", "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 "rhysjones/phi-2-orange" \ --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": "rhysjones/phi-2-orange", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rhysjones/phi-2-orange with Docker Model Runner:
docker model run hf.co/rhysjones/phi-2-orange
How to run model?
hello I'm new to AI. I clone this repo but I can't run it. how to run this model, I try write this text
<|im_start|>system
You are a helpful assistant for Python which outputs in Markdown format.<|im_end|>
... in command-line.
Sorry for this dumb question.
Hey @rekeh ,
There a few ways to run the model - one is within Python using the transformers library. You can click the "Use this model" button on the right hand side of the model page here on HuggingFace to get a starting point for this, together with links to some guides on how to get going. It does involve coding Python, however.
A quicker way is to use an existing desktop client on your machine - this is where projects such as Ollama excel, since they contain everything to run compressed (or quantized) versions of models easily. If you install Ollama, you should then be able to run the model by entering "rhysjones/phi-2-orange" as the model you wish to fetch and use. There are also many other models to try out in the same way - just watch for the size of the models depending on how powerful your machine is.
Hope that helps you continue your AI journey!