Text Generation
Transformers
Safetensors
phi3
Generated from Trainer
trl
sft
conversational
custom_code
text-generation-inference
Instructions to use 1995Austin/phifinetuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 1995Austin/phifinetuning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="1995Austin/phifinetuning", 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("1995Austin/phifinetuning", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("1995Austin/phifinetuning", 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 1995Austin/phifinetuning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "1995Austin/phifinetuning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "1995Austin/phifinetuning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/1995Austin/phifinetuning
- SGLang
How to use 1995Austin/phifinetuning 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 "1995Austin/phifinetuning" \ --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": "1995Austin/phifinetuning", "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 "1995Austin/phifinetuning" \ --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": "1995Austin/phifinetuning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 1995Austin/phifinetuning with Docker Model Runner:
docker model run hf.co/1995Austin/phifinetuning
Download phi-mini/checkpoint-400/trainer_state.json from 1995Austin/phifinetuning: direct link, hf CLI and curl.
- Browser
- Download file 2.37 kB
-
https://huggingface.co/1995Austin/phifinetuning/resolve/main/phi-mini/checkpoint-400/trainer_state.json
- Command line
-
hf download hf://1995Austin/phifinetuning/phi-mini/checkpoint-400/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/1995Austin/phifinetuning/resolve/main/phi-mini/checkpoint-400/trainer_state.json
2.37 kB
| { | |
| "best_metric": 0.7795276641845703, | |
| "best_model_checkpoint": "/content/drive/MyDrive/phifinetuning/checkpoint-400", | |
| "epoch": 0.8888888888888888, | |
| "eval_steps": 100, | |
| "global_step": 400, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.2222222222222222, | |
| "grad_norm": 2.2222509384155273, | |
| "learning_rate": 4.8076923076923084e-05, | |
| "loss": 1.6033, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.2222222222222222, | |
| "eval_loss": 0.8335134387016296, | |
| "eval_runtime": 37.6636, | |
| "eval_samples_per_second": 13.275, | |
| "eval_steps_per_second": 6.638, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.4444444444444444, | |
| "grad_norm": 1.4819945096969604, | |
| "learning_rate": 4.423076923076923e-05, | |
| "loss": 0.8012, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.4444444444444444, | |
| "eval_loss": 0.7985976934432983, | |
| "eval_runtime": 37.7173, | |
| "eval_samples_per_second": 13.257, | |
| "eval_steps_per_second": 6.628, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 1.55106782913208, | |
| "learning_rate": 4.038461538461539e-05, | |
| "loss": 0.7797, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "eval_loss": 0.7857877016067505, | |
| "eval_runtime": 37.6971, | |
| "eval_samples_per_second": 13.264, | |
| "eval_steps_per_second": 6.632, | |
| "step": 300 | |
| }, | |
| { | |
| "epoch": 0.8888888888888888, | |
| "grad_norm": 1.5318647623062134, | |
| "learning_rate": 3.653846153846154e-05, | |
| "loss": 0.7596, | |
| "step": 400 | |
| }, | |
| { | |
| "epoch": 0.8888888888888888, | |
| "eval_loss": 0.7795276641845703, | |
| "eval_runtime": 37.5491, | |
| "eval_samples_per_second": 13.316, | |
| "eval_steps_per_second": 6.658, | |
| "step": 400 | |
| } | |
| ], | |
| "logging_steps": 100, | |
| "max_steps": 1350, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 6629189291335680.0, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |