Instructions to use Maikhang/phogpt-vismimo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Maikhang/phogpt-vismimo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Maikhang/phogpt-vismimo", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Maikhang/phogpt-vismimo", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Maikhang/phogpt-vismimo", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Maikhang/phogpt-vismimo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Maikhang/phogpt-vismimo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Maikhang/phogpt-vismimo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Maikhang/phogpt-vismimo
- SGLang
How to use Maikhang/phogpt-vismimo 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 "Maikhang/phogpt-vismimo" \ --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": "Maikhang/phogpt-vismimo", "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 "Maikhang/phogpt-vismimo" \ --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": "Maikhang/phogpt-vismimo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Maikhang/phogpt-vismimo with Docker Model Runner:
docker model run hf.co/Maikhang/phogpt-vismimo
| { | |
| "_name_or_path": "vinai/PhoGPT-4B-Chat", | |
| "architectures": [ | |
| "MPTForCausalLM" | |
| ], | |
| "attn_config": { | |
| "alibi": true, | |
| "alibi_bias_max": 8, | |
| "attn_impl": "torch", | |
| "attn_pdrop": 0.0, | |
| "attn_type": "multihead_attention", | |
| "attn_uses_sequence_id": false, | |
| "clip_qkv": null, | |
| "prefix_lm": false, | |
| "qk_gn": false, | |
| "qk_ln": false, | |
| "rope": false, | |
| "rope_dail_config": { | |
| "pos_idx_in_fp32": true, | |
| "type": "original", | |
| "xpos_scale_base": 512 | |
| }, | |
| "rope_hf_config": { | |
| "factor": 1.0, | |
| "type": "no_scaling" | |
| }, | |
| "rope_impl": "dail", | |
| "rope_theta": 10000, | |
| "sliding_window_size": -1, | |
| "softmax_scale": null | |
| }, | |
| "auto_map": { | |
| "AutoConfig": "vinai/PhoGPT-4B-Chat--configuration_mpt.MPTConfig", | |
| "AutoModelForCausalLM": "vinai/PhoGPT-4B-Chat--modeling_mpt.MPTForCausalLM" | |
| }, | |
| "d_model": 3072, | |
| "emb_pdrop": 0.0, | |
| "embedding_fraction": 1.0, | |
| "expansion_ratio": 4, | |
| "fc_type": "torch", | |
| "ffn_config": { | |
| "fc_type": "torch", | |
| "ffn_type": "mptmlp" | |
| }, | |
| "init_config": { | |
| "emb_init_std": null, | |
| "emb_init_uniform_lim": null, | |
| "fan_mode": "fan_in", | |
| "init_div_is_residual": true, | |
| "init_gain": 0.0, | |
| "init_nonlinearity": "relu", | |
| "init_std": null, | |
| "name": "kaiming_normal_", | |
| "verbose": 0 | |
| }, | |
| "init_device": "cpu", | |
| "learned_pos_emb": false, | |
| "logit_scale": null, | |
| "max_seq_len": 8192, | |
| "model_type": "mpt", | |
| "n_heads": 24, | |
| "n_layers": 32, | |
| "no_bias": false, | |
| "norm_type": "low_precision_layernorm", | |
| "resid_pdrop": 0.0, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.38.2", | |
| "use_cache": false, | |
| "use_pad_tok_in_ffn": true, | |
| "verbose": 0, | |
| "vocab_size": 20480 | |
| } | |