Instructions to use Sayan01/Phi2-by3-CKA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sayan01/Phi2-by3-CKA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sayan01/Phi2-by3-CKA")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sayan01/Phi2-by3-CKA") model = AutoModelForCausalLM.from_pretrained("Sayan01/Phi2-by3-CKA", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sayan01/Phi2-by3-CKA with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sayan01/Phi2-by3-CKA" # 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-by3-CKA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sayan01/Phi2-by3-CKA
- SGLang
How to use Sayan01/Phi2-by3-CKA 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-by3-CKA" \ --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-by3-CKA", "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-by3-CKA" \ --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-by3-CKA", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sayan01/Phi2-by3-CKA with Docker Model Runner:
docker model run hf.co/Sayan01/Phi2-by3-CKA
Upload PhiForCausalLM
Browse files- config.json +4 -4
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -9,9 +9,9 @@
|
|
| 9 |
"embd_pdrop": 0.0,
|
| 10 |
"eos_token_id": 50256,
|
| 11 |
"hidden_act": "gelu_new",
|
| 12 |
-
"hidden_size":
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
-
"intermediate_size":
|
| 15 |
"layer_norm_eps": 1e-05,
|
| 16 |
"max_position_embeddings": 2048,
|
| 17 |
"model_type": "phi",
|
|
@@ -19,13 +19,13 @@
|
|
| 19 |
"num_beams": null,
|
| 20 |
"num_hidden_layers": 16,
|
| 21 |
"num_key_value_heads": 32,
|
| 22 |
-
"partial_rotary_factor": 0.
|
| 23 |
"qk_layernorm": false,
|
| 24 |
"resid_pdrop": 0.1,
|
| 25 |
"rope_scaling": null,
|
| 26 |
"rope_theta": 10000.0,
|
| 27 |
"tie_word_embeddings": false,
|
| 28 |
-
"torch_dtype": "
|
| 29 |
"transformers_version": "4.45.2",
|
| 30 |
"use_cache": true,
|
| 31 |
"vocab_size": 51200
|
|
|
|
| 9 |
"embd_pdrop": 0.0,
|
| 10 |
"eos_token_id": 50256,
|
| 11 |
"hidden_act": "gelu_new",
|
| 12 |
+
"hidden_size": 2048,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 8192,
|
| 15 |
"layer_norm_eps": 1e-05,
|
| 16 |
"max_position_embeddings": 2048,
|
| 17 |
"model_type": "phi",
|
|
|
|
| 19 |
"num_beams": null,
|
| 20 |
"num_hidden_layers": 16,
|
| 21 |
"num_key_value_heads": 32,
|
| 22 |
+
"partial_rotary_factor": 0.5,
|
| 23 |
"qk_layernorm": false,
|
| 24 |
"resid_pdrop": 0.1,
|
| 25 |
"rope_scaling": null,
|
| 26 |
"rope_theta": 10000.0,
|
| 27 |
"tie_word_embeddings": false,
|
| 28 |
+
"torch_dtype": "bfloat16",
|
| 29 |
"transformers_version": "4.45.2",
|
| 30 |
"use_cache": true,
|
| 31 |
"vocab_size": 51200
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27d1084bd29d4479f4ef4642f033dc0ab9645dcc1f54548e3958b6333a649e70
|
| 3 |
+
size 2030899760
|