Text Generation
Transformers
Safetensors
phi
trl
sft
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use DataKensei/phi-2-function-calling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DataKensei/phi-2-function-calling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DataKensei/phi-2-function-calling")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DataKensei/phi-2-function-calling") model = AutoModelForCausalLM.from_pretrained("DataKensei/phi-2-function-calling") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use DataKensei/phi-2-function-calling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DataKensei/phi-2-function-calling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DataKensei/phi-2-function-calling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/DataKensei/phi-2-function-calling
- SGLang
How to use DataKensei/phi-2-function-calling 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 "DataKensei/phi-2-function-calling" \ --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": "DataKensei/phi-2-function-calling", "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 "DataKensei/phi-2-function-calling" \ --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": "DataKensei/phi-2-function-calling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use DataKensei/phi-2-function-calling with Docker Model Runner:
docker model run hf.co/DataKensei/phi-2-function-calling
Update README.md
Browse files
README.md
CHANGED
|
@@ -165,25 +165,22 @@ The model was evaluated using a separate test set, comprising 10% of the origina
|
|
| 165 |
<!-- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). -->
|
| 166 |
|
| 167 |
|
| 168 |
-
\usepackage{hyperref}
|
| 169 |
-
|
| 170 |
-
\subsection{CO2 Emission Related to Experiments}
|
| 171 |
|
| 172 |
Experiments were conducted using a private infrastructure, which has a carbon efficiency of 0.432 kgCO$_2$eq/kWh. A cumulative of 10 hours of computation was performed on hardware of type GTX 1080 (TDP of 180W).
|
| 173 |
|
| 174 |
-
Total emissions are estimated to be 0.78 kgCO
|
| 175 |
|
| 176 |
-
%Uncomment if you bought additional offsets:
|
| 177 |
-
%XX kg CO2eq were manually offset through \href{link}{Offset Provider}.
|
| 178 |
|
| 179 |
-
Estimations were conducted using the
|
| 180 |
|
|
|
|
| 181 |
@article{lacoste2019quantifying,
|
| 182 |
title={Quantifying the Carbon Emissions of Machine Learning},
|
| 183 |
author={Lacoste, Alexandre and Luccioni, Alexandra and Schmidt, Victor and Dandres, Thomas},
|
| 184 |
journal={arXiv preprint arXiv:1910.09700},
|
| 185 |
year={2019}
|
| 186 |
}
|
|
|
|
| 187 |
|
| 188 |
|
| 189 |
- **Hardware Type:** NVIDIA GPUs (GTX 1080)
|
|
@@ -214,7 +211,7 @@ The training used PyTorch and the Hugging Face Transformers library, with additi
|
|
| 214 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 215 |
|
| 216 |
**BibTeX:**
|
| 217 |
-
|
| 218 |
@misc{phi2functioncalling,
|
| 219 |
title={phi-2-function-calling},
|
| 220 |
author={Carlos Rodrigues},
|
|
@@ -222,6 +219,7 @@ The training used PyTorch and the Hugging Face Transformers library, with additi
|
|
| 222 |
publisher={Hugging Face},
|
| 223 |
howpublished={\url{https://huggingface.co/DataKensei/phi-2-function-calling}},
|
| 224 |
}
|
|
|
|
| 225 |
|
| 226 |
## Model Card Contact
|
| 227 |
|
|
|
|
| 165 |
<!-- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). -->
|
| 166 |
|
| 167 |
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
Experiments were conducted using a private infrastructure, which has a carbon efficiency of 0.432 kgCO$_2$eq/kWh. A cumulative of 10 hours of computation was performed on hardware of type GTX 1080 (TDP of 180W).
|
| 170 |
|
| 171 |
+
Total emissions are estimated to be 0.78 kgCO of which 0 percents were directly offset.
|
| 172 |
|
|
|
|
|
|
|
| 173 |
|
| 174 |
+
Estimations were conducted using the [MachineLearning Impact calculator](https://mlco2.github.io/impact#compute) presented in presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700)
|
| 175 |
|
| 176 |
+
```
|
| 177 |
@article{lacoste2019quantifying,
|
| 178 |
title={Quantifying the Carbon Emissions of Machine Learning},
|
| 179 |
author={Lacoste, Alexandre and Luccioni, Alexandra and Schmidt, Victor and Dandres, Thomas},
|
| 180 |
journal={arXiv preprint arXiv:1910.09700},
|
| 181 |
year={2019}
|
| 182 |
}
|
| 183 |
+
```
|
| 184 |
|
| 185 |
|
| 186 |
- **Hardware Type:** NVIDIA GPUs (GTX 1080)
|
|
|
|
| 211 |
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 212 |
|
| 213 |
**BibTeX:**
|
| 214 |
+
```
|
| 215 |
@misc{phi2functioncalling,
|
| 216 |
title={phi-2-function-calling},
|
| 217 |
author={Carlos Rodrigues},
|
|
|
|
| 219 |
publisher={Hugging Face},
|
| 220 |
howpublished={\url{https://huggingface.co/DataKensei/phi-2-function-calling}},
|
| 221 |
}
|
| 222 |
+
```
|
| 223 |
|
| 224 |
## Model Card Contact
|
| 225 |
|