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 Settings
- 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 did you train this? Which hyperparameters did you select?
... maybe you could share this?
If it is trained with Axolotl: perhaps you could share the configuration with us?
The training was a multi-step one using the AxonZeta platform (not released yet - it's still under development, incorporating different tools such as HF / Accelerate, Axolotl, LM evals, custom lora merge / factorisation etc. and a lot of orchestration).
The idea is to have multi-epoch training on different datasets where you take the best performing checkpoints onto the next step (i.e. not necessarily assume the best one is at the end of epoch N). This is coupled with a multi-run system where you give a range of hyperparameters to try as well - e.g. full or qlora (and if qlora the rank and delta ranges to train with, and an optional separate delta to merge with), learning rates etc. The platform represents these as a hierarchy of training steps, with the ultimate aim of converge-training a range of performant finetuned agent models.
The inter-step evaluation process is interesting - as well as LM Evaluation Harness etc. it also brings in tools such as WeightWatcher to measure the effect of a lora on the base model as it progresses - especially useful on smaller models, where you can overfit / overwhelm the existing weights and end up with a specific but worse-off model.
I should put all of this in a blog post with more details on the AxonZeta platform with phi-2-orange (or later iterations) as an example. There are also Mistral, a Yi-6 and Yi-34 trials underway as well.