Instructions to use cfli/test_minicpm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cfli/test_minicpm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cfli/test_minicpm", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("cfli/test_minicpm", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cfli/test_minicpm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cfli/test_minicpm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cfli/test_minicpm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cfli/test_minicpm
- SGLang
How to use cfli/test_minicpm 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 "cfli/test_minicpm" \ --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": "cfli/test_minicpm", "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 "cfli/test_minicpm" \ --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": "cfli/test_minicpm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cfli/test_minicpm with Docker Model Runner:
docker model run hf.co/cfli/test_minicpm
Create config.json
Browse files- config.json +32 -0
config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "openbmb/CPM-2B",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MiniCPMForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_minicpm.MiniCPMConfig",
|
| 8 |
+
"AutoModel": "modeling_minicpm.MiniCPMModel",
|
| 9 |
+
"AutoModelForCausalLM": "modeling_minicpm.MiniCPMForCausalLM",
|
| 10 |
+
"AutoModelForSeq2SeqLM": "modeling_minicpm.MiniCPMForCausalLM",
|
| 11 |
+
"AutoModelForSequenceClassification": "modeling_minicpm.MiniCPMForSequenceClassification"
|
| 12 |
+
},
|
| 13 |
+
"bos_token_id": 1,
|
| 14 |
+
"eos_token_id": 2,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 2304,
|
| 17 |
+
"initializer_range": 0.1,
|
| 18 |
+
"intermediate_size": 5760,
|
| 19 |
+
"max_position_embeddings": 2048,
|
| 20 |
+
"num_attention_heads": 36,
|
| 21 |
+
"num_hidden_layers": 40,
|
| 22 |
+
"num_key_value_heads": 36,
|
| 23 |
+
"rms_norm_eps": 1e-05,
|
| 24 |
+
"rope_scaling": null,
|
| 25 |
+
"torch_dtype": "bfloat16",
|
| 26 |
+
"transformers_version": "4.36.0",
|
| 27 |
+
"use_cache": true,
|
| 28 |
+
"vocab_size": 122753,
|
| 29 |
+
"scale_emb": 12,
|
| 30 |
+
"dim_model_base": 256,
|
| 31 |
+
"scale_depth": 1.4
|
| 32 |
+
}
|