Instructions to use LilPhat23/PhoGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use LilPhat23/PhoGPT with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("vinai/phogpt-4b-chat") model = PeftModel.from_pretrained(base_model, "LilPhat23/PhoGPT") - Transformers
How to use LilPhat23/PhoGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LilPhat23/PhoGPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("LilPhat23/PhoGPT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LilPhat23/PhoGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LilPhat23/PhoGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LilPhat23/PhoGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LilPhat23/PhoGPT
- SGLang
How to use LilPhat23/PhoGPT 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 "LilPhat23/PhoGPT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LilPhat23/PhoGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "LilPhat23/PhoGPT" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LilPhat23/PhoGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LilPhat23/PhoGPT with Docker Model Runner:
docker model run hf.co/LilPhat23/PhoGPT
Upload 2 files
Browse files- config.json +51 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MPTForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attn_config": {
|
| 6 |
+
"alibi": true,
|
| 7 |
+
"alibi_bias_max": 8,
|
| 8 |
+
"attn_impl": "torch",
|
| 9 |
+
"attn_pdrop": 0.0,
|
| 10 |
+
"attn_type": "multihead_attention",
|
| 11 |
+
"attn_uses_sequence_id": false,
|
| 12 |
+
"clip_qkv": null,
|
| 13 |
+
"prefix_lm": false,
|
| 14 |
+
"qk_ln": false,
|
| 15 |
+
"softmax_scale": null
|
| 16 |
+
},
|
| 17 |
+
"auto_map": {
|
| 18 |
+
"AutoConfig": "configuration_mpt.MPTConfig",
|
| 19 |
+
"AutoModelForCausalLM": "modeling_mpt.MPTForCausalLM"
|
| 20 |
+
},
|
| 21 |
+
"d_model": 3072,
|
| 22 |
+
"emb_pdrop": 0.0,
|
| 23 |
+
"embedding_fraction": 1.0,
|
| 24 |
+
"expansion_ratio": 4,
|
| 25 |
+
"init_config": {
|
| 26 |
+
"emb_init_std": null,
|
| 27 |
+
"emb_init_uniform_lim": null,
|
| 28 |
+
"fan_mode": "fan_in",
|
| 29 |
+
"init_div_is_residual": true,
|
| 30 |
+
"init_gain": 0.0,
|
| 31 |
+
"init_nonlinearity": "relu",
|
| 32 |
+
"init_std": null,
|
| 33 |
+
"name": "kaiming_normal_",
|
| 34 |
+
"verbose": 0
|
| 35 |
+
},
|
| 36 |
+
"init_device": "cpu",
|
| 37 |
+
"learned_pos_emb": true,
|
| 38 |
+
"logit_scale": null,
|
| 39 |
+
"max_seq_len": 8192,
|
| 40 |
+
"model_type": "mpt",
|
| 41 |
+
"n_heads": 24,
|
| 42 |
+
"n_layers": 32,
|
| 43 |
+
"no_bias": false,
|
| 44 |
+
"norm_type": "low_precision_layernorm",
|
| 45 |
+
"resid_pdrop": 0.0,
|
| 46 |
+
"torch_dtype": "bfloat16",
|
| 47 |
+
"transformers_version": "4.30.2",
|
| 48 |
+
"use_cache": false,
|
| 49 |
+
"verbose": 0,
|
| 50 |
+
"vocab_size": 20480
|
| 51 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:05fe42743ffda3b8e020d1f73140cf95aed7361c7e2d908d909406c15c47ac62
|
| 3 |
+
size 7376279965
|