Instructions to use BeaverAI/Cream-Phi-3-14B-v1a with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BeaverAI/Cream-Phi-3-14B-v1a with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BeaverAI/Cream-Phi-3-14B-v1a", 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("BeaverAI/Cream-Phi-3-14B-v1a", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("BeaverAI/Cream-Phi-3-14B-v1a", 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 BeaverAI/Cream-Phi-3-14B-v1a with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BeaverAI/Cream-Phi-3-14B-v1a" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BeaverAI/Cream-Phi-3-14B-v1a", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BeaverAI/Cream-Phi-3-14B-v1a
- SGLang
How to use BeaverAI/Cream-Phi-3-14B-v1a 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 "BeaverAI/Cream-Phi-3-14B-v1a" \ --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": "BeaverAI/Cream-Phi-3-14B-v1a", "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 "BeaverAI/Cream-Phi-3-14B-v1a" \ --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": "BeaverAI/Cream-Phi-3-14B-v1a", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BeaverAI/Cream-Phi-3-14B-v1a with Docker Model Runner:
docker model run hf.co/BeaverAI/Cream-Phi-3-14B-v1a
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
tldr; This is Phi 3 Medium finetuned for (mainly SFW) roleplaying.
It was a promising release candidate that fell flat when things got moist.
I'm publishing all the details for anyone else interested in finetuning Phi 3.
Training Details:
- 8x H100 80GB SXM GPUs
- 1 hour training time
Results for Roleplay Mode (i.e., not Instruct format):
- Strong RP formatting.
- Tends to output short, straightforward replies to the player character.
- Starts to break down when things get moist.
- Important: My testing is lazy and flawed. Take it with a grain of salt and test the GGUFs before taking notes.
Axolotl Config (some fields omitted)
base_model: failspy/Phi-3-medium-4k-instruct-abliterated-v3
load_in_4bit: true
bf16: auto
fp16:
tf32: false
flash_attention: true
sequence_len: 4096
datasets:
- path: Undi95/andrijdavid_roleplay-conversation-sharegpt
type: customphi3
num_epochs: 2
warmup_steps: 30
weight_decay: 0.1
adapter: lora
lora_r: 128
lora_alpha: 16
lora_dropout: 0.1
lora_target_linear: true
gradient_accumulation_steps: 2
micro_batch_size: 2
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: true
sample_packing: true
pad_to_sequence_len: true
optimizer: paged_adamw_8bit
lr_scheduler: cosine
learning_rate: 0.0001
max_grad_norm: 1.0
val_set_size: 0.01
evals_per_epoch: 3
eval_max_new_tokens: 128
eval_batch_size: 1
- Downloads last month
- 845
