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)# 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) - Inference
- 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 ·
2536e0a
1
Parent(s): 80d01d4
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,10 +11,10 @@ tags:
|
|
| 11 |
---
|
| 12 |
# Model Card for Model ID
|
| 13 |
|
| 14 |
-
This is the adapters from the LoRa fine-tuning of the phi-2 model from Microsoft. It was trained on the Electrical-engineering dataset.
|
| 15 |
|
| 16 |
- **Developed by:** STEM.AI
|
| 17 |
-
- **Model type:** Q&A
|
| 18 |
- **Language(s) (NLP):** English
|
| 19 |
- **Finetuned from model [optional]:** microsoft/phi-2
|
| 20 |
|
|
@@ -28,16 +28,19 @@ Q&A related to electrical engineering, and Kicad software. Creation of Python co
|
|
| 28 |
|
| 29 |
### Training Data
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
### Training Procedure
|
| 36 |
|
| 37 |
-
A LoRa PEFT was performed on a 48 Gb Nvidia GPU.
|
| 38 |
|
| 39 |
## Model Card Authors [optional]
|
| 40 |
|
| 41 |
STEM.AI: stem.ai.mtl@gmail.com
|
|
|
|
| 42 |
|
| 43 |
|
|
|
|
| 11 |
---
|
| 12 |
# Model Card for Model ID
|
| 13 |
|
| 14 |
+
This is the adapters from the LoRa fine-tuning of the phi-2 model from Microsoft. It was trained on the Electrical-engineering dataset combined with garage-bAInd/Open-Platypus.
|
| 15 |
|
| 16 |
- **Developed by:** STEM.AI
|
| 17 |
+
- **Model type:** Q&A and code generation
|
| 18 |
- **Language(s) (NLP):** English
|
| 19 |
- **Finetuned from model [optional]:** microsoft/phi-2
|
| 20 |
|
|
|
|
| 28 |
|
| 29 |
### Training Data
|
| 30 |
|
| 31 |
+
Dataset related to electrical engineering: STEM-AI-mtl/Electrical-engineering
|
| 32 |
|
| 33 |
+
Combined with
|
| 34 |
+
|
| 35 |
+
Dataset related to STEM and NLP: garage-bAInd/Open-Platypus
|
| 36 |
|
| 37 |
### Training Procedure
|
| 38 |
|
| 39 |
+
A LoRa PEFT was performed on a 48 Gb A40 Nvidia GPU.
|
| 40 |
|
| 41 |
## Model Card Authors [optional]
|
| 42 |
|
| 43 |
STEM.AI: stem.ai.mtl@gmail.com
|
| 44 |
+
William Harbec
|
| 45 |
|
| 46 |
|