Instructions to use Sayan01/Phi2-FLAN with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sayan01/Phi2-FLAN with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sayan01/Phi2-FLAN")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sayan01/Phi2-FLAN") model = AutoModelForCausalLM.from_pretrained("Sayan01/Phi2-FLAN", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sayan01/Phi2-FLAN with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sayan01/Phi2-FLAN" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sayan01/Phi2-FLAN", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sayan01/Phi2-FLAN
- SGLang
How to use Sayan01/Phi2-FLAN 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 "Sayan01/Phi2-FLAN" \ --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": "Sayan01/Phi2-FLAN", "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 "Sayan01/Phi2-FLAN" \ --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": "Sayan01/Phi2-FLAN", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sayan01/Phi2-FLAN with Docker Model Runner:
docker model run hf.co/Sayan01/Phi2-FLAN
Upload tokenizer
Browse files- added_tokens.json +2 -1
- special_tokens_map.json +7 -0
- tokenizer.json +9 -0
- tokenizer_config.json +9 -0
added_tokens.json
CHANGED
|
@@ -36,5 +36,6 @@
|
|
| 36 |
" ": 50260,
|
| 37 |
" ": 50259,
|
| 38 |
" ": 50258,
|
| 39 |
-
" ": 50257
|
|
|
|
| 40 |
}
|
|
|
|
| 36 |
" ": 50260,
|
| 37 |
" ": 50259,
|
| 38 |
" ": 50258,
|
| 39 |
+
" ": 50257,
|
| 40 |
+
"[PAD]": 50295
|
| 41 |
}
|
special_tokens_map.json
CHANGED
|
@@ -13,6 +13,13 @@
|
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
"unk_token": {
|
| 17 |
"content": "<|endoftext|>",
|
| 18 |
"lstrip": false,
|
|
|
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "[PAD]",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
"unk_token": {
|
| 24 |
"content": "<|endoftext|>",
|
| 25 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -353,6 +353,15 @@
|
|
| 353 |
"rstrip": false,
|
| 354 |
"normalized": true,
|
| 355 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
}
|
| 357 |
],
|
| 358 |
"normalizer": null,
|
|
|
|
| 353 |
"rstrip": false,
|
| 354 |
"normalized": true,
|
| 355 |
"special": false
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"id": 50295,
|
| 359 |
+
"content": "[PAD]",
|
| 360 |
+
"single_word": false,
|
| 361 |
+
"lstrip": false,
|
| 362 |
+
"rstrip": false,
|
| 363 |
+
"normalized": false,
|
| 364 |
+
"special": true
|
| 365 |
}
|
| 366 |
],
|
| 367 |
"normalizer": null,
|
tokenizer_config.json
CHANGED
|
@@ -312,12 +312,21 @@
|
|
| 312 |
"rstrip": false,
|
| 313 |
"single_word": false,
|
| 314 |
"special": false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
}
|
| 316 |
},
|
| 317 |
"bos_token": "<|endoftext|>",
|
| 318 |
"clean_up_tokenization_spaces": true,
|
| 319 |
"eos_token": "<|endoftext|>",
|
| 320 |
"model_max_length": 2048,
|
|
|
|
| 321 |
"tokenizer_class": "CodeGenTokenizer",
|
| 322 |
"unk_token": "<|endoftext|>"
|
| 323 |
}
|
|
|
|
| 312 |
"rstrip": false,
|
| 313 |
"single_word": false,
|
| 314 |
"special": false
|
| 315 |
+
},
|
| 316 |
+
"50295": {
|
| 317 |
+
"content": "[PAD]",
|
| 318 |
+
"lstrip": false,
|
| 319 |
+
"normalized": false,
|
| 320 |
+
"rstrip": false,
|
| 321 |
+
"single_word": false,
|
| 322 |
+
"special": true
|
| 323 |
}
|
| 324 |
},
|
| 325 |
"bos_token": "<|endoftext|>",
|
| 326 |
"clean_up_tokenization_spaces": true,
|
| 327 |
"eos_token": "<|endoftext|>",
|
| 328 |
"model_max_length": 2048,
|
| 329 |
+
"pad_token": "[PAD]",
|
| 330 |
"tokenizer_class": "CodeGenTokenizer",
|
| 331 |
"unk_token": "<|endoftext|>"
|
| 332 |
}
|