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
|
@@ -173,7 +173,7 @@ Total emissions are estimated to be 0.78 kgCO of which 0 percents were directly
|
|
| 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},
|
|
@@ -211,7 +211,7 @@ The training used PyTorch and the Hugging Face Transformers library, with additi
|
|
| 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},
|
|
|
|
| 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 |
+
```BibTeX
|
| 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},
|
|
|
|
| 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 |
+
```BibTeX
|
| 215 |
@misc{phi2functioncalling,
|
| 216 |
title={phi-2-function-calling},
|
| 217 |
author={Carlos Rodrigues},
|