Instructions to use MalikIbrar/flan-python-expert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MalikIbrar/flan-python-expert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MalikIbrar/flan-python-expert")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("MalikIbrar/flan-python-expert") model = AutoModelForSeq2SeqLM.from_pretrained("MalikIbrar/flan-python-expert") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MalikIbrar/flan-python-expert with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MalikIbrar/flan-python-expert" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MalikIbrar/flan-python-expert", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MalikIbrar/flan-python-expert
- SGLang
How to use MalikIbrar/flan-python-expert 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 "MalikIbrar/flan-python-expert" \ --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": "MalikIbrar/flan-python-expert", "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 "MalikIbrar/flan-python-expert" \ --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": "MalikIbrar/flan-python-expert", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MalikIbrar/flan-python-expert with Docker Model Runner:
docker model run hf.co/MalikIbrar/flan-python-expert
Upload tokenizer
Browse files- tokenizer_config.json +8 -0
tokenizer_config.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"0": {
|
| 4 |
"content": "<pad>",
|
|
@@ -931,9 +932,16 @@
|
|
| 931 |
"eos_token": "</s>",
|
| 932 |
"extra_ids": 100,
|
| 933 |
"extra_special_tokens": {},
|
|
|
|
| 934 |
"model_max_length": 512,
|
|
|
|
| 935 |
"pad_token": "<pad>",
|
|
|
|
|
|
|
| 936 |
"sp_model_kwargs": {},
|
|
|
|
| 937 |
"tokenizer_class": "T5Tokenizer",
|
|
|
|
|
|
|
| 938 |
"unk_token": "<unk>"
|
| 939 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
"added_tokens_decoder": {
|
| 4 |
"0": {
|
| 5 |
"content": "<pad>",
|
|
|
|
| 932 |
"eos_token": "</s>",
|
| 933 |
"extra_ids": 100,
|
| 934 |
"extra_special_tokens": {},
|
| 935 |
+
"max_length": 1024,
|
| 936 |
"model_max_length": 512,
|
| 937 |
+
"pad_to_multiple_of": null,
|
| 938 |
"pad_token": "<pad>",
|
| 939 |
+
"pad_token_type_id": 0,
|
| 940 |
+
"padding_side": "right",
|
| 941 |
"sp_model_kwargs": {},
|
| 942 |
+
"stride": 0,
|
| 943 |
"tokenizer_class": "T5Tokenizer",
|
| 944 |
+
"truncation_side": "right",
|
| 945 |
+
"truncation_strategy": "longest_first",
|
| 946 |
"unk_token": "<unk>"
|
| 947 |
}
|