Instructions to use phanerozoic/Phi-2-Pirate-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use phanerozoic/Phi-2-Pirate-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="phanerozoic/Phi-2-Pirate-v0.1", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("phanerozoic/Phi-2-Pirate-v0.1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use phanerozoic/Phi-2-Pirate-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "phanerozoic/Phi-2-Pirate-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "phanerozoic/Phi-2-Pirate-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/phanerozoic/Phi-2-Pirate-v0.1
- SGLang
How to use phanerozoic/Phi-2-Pirate-v0.1 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 "phanerozoic/Phi-2-Pirate-v0.1" \ --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": "phanerozoic/Phi-2-Pirate-v0.1", "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 "phanerozoic/Phi-2-Pirate-v0.1" \ --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": "phanerozoic/Phi-2-Pirate-v0.1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use phanerozoic/Phi-2-Pirate-v0.1 with Docker Model Runner:
docker model run hf.co/phanerozoic/Phi-2-Pirate-v0.1
Phi2-Pirate-v0.1
Phi2-Pirate-v0.1 is a fine-tuned version of the Microsoft Phi-2 model, specifically adapted for generating authentic pirate-themed content. This model combines the technical sophistication of Phi-2 with a specialized focus on pirate vernacular.
- Developed by: Phanerozoic
- License: cc-by-nc-4.0
- Finetuned from: Phi-2
Version Control
Phi2-Pirate-v0.1 marks the initial release of this specialized language model.
Performance
Phi2-Pirate-v0.1 demonstrates a notable ability in generating coherent and contextually appropriate pirate-themed content. This model has fewer limitations than its predecessors and offers high-quality outputs.
Direct Use
Suited for thematic language generation in various applications, including entertainment, educational platforms, and any environment requiring pirate-style communication.
Training Data
The model was fine-tuned on a dataset of higher quality compared to that used for the TinyLlama pirate model, ensuring a richer linguistic experience.
Custom Stopping Strings
To enhance output quality, the following custom stopping strings were employed:
- "},"
- "User:"
- "You:"
- "\nUser"
- "\nUser:"
- "me:"
- "\n"
Training Hyperparameters and Fine-Tuning Details
- LoRA Alpha: 256
- Dimension Count: 128
- Epochs: Approximately 0.61
- Global Steps: 793
- Learning Rate: 0.0002
- Loss: 0.6002
Limitations
As a specialized model, Phi-Pirate-v0.1 is not designed for general language tasks but excels in generating pirate-themed content.
Compute Infrastructure
The model was efficiently trained with significantly higher hyperparameters than typical language models, indicative of its specialized nature.
Results
Phi2-Pirate-v0.1 successfully produces engaging pirate-themed responses, showing its capability to handle a variety of related topics. The model's pirate dialect is consistent, adding to the immersive experience.
Summary
Phi2-Pirate-v0.1 represents an innovative approach in specialized language models. It stands out for its ability to combine the advanced capabilities of Phi-2 with the thematic accuracy needed for pirate speak.
Acknowledgments
Thanks to the developers of the original Phi-2 model for their foundational work, which was crucial for the creation of Phi-Pirate-v0.1.
- Downloads last month
- 15
