Text Generation
Transformers
TensorBoard
Safetensors
phi
alignment-handbook
trl
sft
Generated from Trainer
conversational
custom_code
text-generation-inference
Instructions to use ondevicellm/phi-1_5_sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ondevicellm/phi-1_5_sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ondevicellm/phi-1_5_sft", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ondevicellm/phi-1_5_sft", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("ondevicellm/phi-1_5_sft", trust_remote_code=True, device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ondevicellm/phi-1_5_sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ondevicellm/phi-1_5_sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ondevicellm/phi-1_5_sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ondevicellm/phi-1_5_sft
- SGLang
How to use ondevicellm/phi-1_5_sft 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 "ondevicellm/phi-1_5_sft" \ --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": "ondevicellm/phi-1_5_sft", "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 "ondevicellm/phi-1_5_sft" \ --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": "ondevicellm/phi-1_5_sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ondevicellm/phi-1_5_sft with Docker Model Runner:
docker model run hf.co/ondevicellm/phi-1_5_sft
Commit History
-
End of training
Verified signaturebbbc1ab -
Model save
Verified signatured9da186 -
Training in progress, step 2900
Verified signature5cb3a99 -
Training in progress, step 2800
Verified signature8e80b74 -
Training in progress, step 2700
Verified signature8bd61fb -
Training in progress, step 2600
Verified signature3bc354f -
Training in progress, step 2400
Verified signaturee33d3f9 -
Training in progress, step 2300
Verified signature5c4111b -
Training in progress, step 2200
Verified signatureb5104ff -
Training in progress, step 2100
Verified signaturee7899ac -
Training in progress, step 2000
Verified signatured2598e6 -
Training in progress, step 1900
Verified signature4006760 -
Training in progress, step 1800
Verified signature47fbfb0 -
Training in progress, step 1700
Verified signature2b367b6 -
Training in progress, step 1500
Verified signature8960326
-
Training in progress, step 1400
Verified signature87ac34d -
Training in progress, step 1300
Verified signature33a4b39 -
Training in progress, step 1200
Verified signaturef41ab0a -
Training in progress, step 1100
Verified signaturee4c6047 -
Training in progress, step 1000
Verified signaturedea4005 -
Training in progress, step 900
Verified signature24376ae -
Training in progress, step 800
Verified signature2cdfa33 -
Training in progress, step 700
Verified signature2fb7c16 -
Training in progress, step 500
Verified signature0d9c784 -
Training in progress, step 400
Verified signature1c273f1 -
Training in progress, step 100
Verified signatureb1c27fe -
initial commit
Verified signature462fcc3