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
|
@@ -162,13 +162,34 @@ The model was evaluated using a separate test set, comprising 10% of the origina
|
|
| 162 |
|
| 163 |
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 164 |
|
| 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 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
## Technical Specifications
|
| 174 |
|
|
|
|
| 162 |
|
| 163 |
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 164 |
|
| 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$_2$eq of which 0 percents were directly offset.
|
| 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 \href{https://mlco2.github.io/impact#compute}{MachineLearning Impact calculator} presented in \cite{lacoste2019quantifying}.
|
| 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)
|
| 190 |
+
- **Hours used:** 10
|
| 191 |
+
- **Cloud Provider:** Private Infrastructure
|
| 192 |
+
- **Carbon Emitted:** 0.78 kgCO
|
| 193 |
|
| 194 |
## Technical Specifications
|
| 195 |
|