Text Generation
Transformers
Safetensors
English
phi
phi-2
electrical engineering
Microsoft
custom_code
text-generation-inference
Instructions to use STEM-AI-mtl/phi-2-electrical-engineering with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use STEM-AI-mtl/phi-2-electrical-engineering with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="STEM-AI-mtl/phi-2-electrical-engineering", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("STEM-AI-mtl/phi-2-electrical-engineering", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("STEM-AI-mtl/phi-2-electrical-engineering", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use STEM-AI-mtl/phi-2-electrical-engineering with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "STEM-AI-mtl/phi-2-electrical-engineering" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "STEM-AI-mtl/phi-2-electrical-engineering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/STEM-AI-mtl/phi-2-electrical-engineering
- SGLang
How to use STEM-AI-mtl/phi-2-electrical-engineering 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 "STEM-AI-mtl/phi-2-electrical-engineering" \ --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": "STEM-AI-mtl/phi-2-electrical-engineering", "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 "STEM-AI-mtl/phi-2-electrical-engineering" \ --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": "STEM-AI-mtl/phi-2-electrical-engineering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use STEM-AI-mtl/phi-2-electrical-engineering with Docker Model Runner:
docker model run hf.co/STEM-AI-mtl/phi-2-electrical-engineering
Commit History
-
Update README.md
Verified signature9b32208 -
Update README.md
Verified signature01c40c7 -
Update README.md
Verified signatureaf88ba0 -
Update README.md
Verified signature572ff9c
-
Update README.md
Verified signature3356adb -
Update README.md
Verified signature49b4292 -
Update README.md
Verified signatured803e77 -
Update README.md
Verified signature2d09452 -
Update README.md
Verified signaturecf93a3a -
Update README.md
Verified signatureaa70f2a -
Update README.md
Verified signaturee0dafe2 -
Update README.md
Verified signatureea44c8a -
Update config.json
Verified signature24df9a5 -
Update README.md
Verified signature180b1fb -
Upload chat-GPTQ.py
Verified signature019dbde -
Update README.md
Verified signature095ce9f -
Update README.md
Verified signaturebebe3cd -
Update README.md
Verified signatured3f115b -
Update config.json
Verified signaturee8c7d52 -
Update config.json
Verified signaturedaf0380 -
Update config.json
Verified signaturec3f423b
-
Update config.json
Verified signatureae36813 -
Update README.md
Verified signatureaa7ca29 -
Update README.md
Verified signature5a41956
-
Upload tokenizer
Verified signature98fca66 -
Upload PhiForCausalLM
Verified signature5beec68
-
Update README.md
99d7e18
-
Update README.md
6b5aa8d -
Update README.md
0177823 -
Update README.md
351c0b8 -
Update README.md
cd0f87b -
Update README.md
3b790ed -
Update README.md
2536e0a -
Update README.md
80d01d4 -
Update README.md
4f62174 -
Upload 2 files
Adapters from the LoRa fine-tuning of the Phi-2 model from Microsoftdac8c75 -
initial commit
1c2e8fa