Instructions to use anthonyfang/myllm3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use anthonyfang/myllm3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="anthonyfang/myllm3", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("anthonyfang/myllm3", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use anthonyfang/myllm3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "anthonyfang/myllm3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "anthonyfang/myllm3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/anthonyfang/myllm3
- SGLang
How to use anthonyfang/myllm3 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 "anthonyfang/myllm3" \ --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": "anthonyfang/myllm3", "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 "anthonyfang/myllm3" \ --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": "anthonyfang/myllm3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use anthonyfang/myllm3 with Docker Model Runner:
docker model run hf.co/anthonyfang/myllm3
Commit ·
be714c0
1
Parent(s): 6595d7e
Upload ChatGLMForConditionalGeneration
Browse files- config.json +44 -0
- generation_config.json +6 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "THUDM/chatglm2-6b-int4",
|
| 3 |
+
"add_bias_linear": false,
|
| 4 |
+
"add_qkv_bias": true,
|
| 5 |
+
"apply_query_key_layer_scaling": true,
|
| 6 |
+
"apply_residual_connection_post_layernorm": false,
|
| 7 |
+
"architectures": [
|
| 8 |
+
"ChatGLMForConditionalGeneration"
|
| 9 |
+
],
|
| 10 |
+
"attention_dropout": 0.0,
|
| 11 |
+
"attention_softmax_in_fp32": true,
|
| 12 |
+
"auto_map": {
|
| 13 |
+
"AutoConfig": "THUDM/chatglm2-6b-int4--configuration_chatglm.ChatGLMConfig",
|
| 14 |
+
"AutoModel": "THUDM/chatglm2-6b-int4--modeling_chatglm.ChatGLMForConditionalGeneration",
|
| 15 |
+
"AutoModelForSeq2SeqLM": "THUDM/chatglm2-6b-int4--modeling_chatglm.ChatGLMForConditionalGeneration"
|
| 16 |
+
},
|
| 17 |
+
"bias_dropout_fusion": true,
|
| 18 |
+
"eos_token_id": 2,
|
| 19 |
+
"ffn_hidden_size": 13696,
|
| 20 |
+
"fp32_residual_connection": false,
|
| 21 |
+
"hidden_dropout": 0.0,
|
| 22 |
+
"hidden_size": 4096,
|
| 23 |
+
"kv_channels": 128,
|
| 24 |
+
"layernorm_epsilon": 1e-05,
|
| 25 |
+
"model_type": "chatglm",
|
| 26 |
+
"multi_query_attention": true,
|
| 27 |
+
"multi_query_group_num": 2,
|
| 28 |
+
"num_attention_heads": 32,
|
| 29 |
+
"num_layers": 28,
|
| 30 |
+
"original_rope": true,
|
| 31 |
+
"pad_token_id": 0,
|
| 32 |
+
"padded_vocab_size": 65024,
|
| 33 |
+
"post_layer_norm": true,
|
| 34 |
+
"pre_seq_len": 128,
|
| 35 |
+
"prefix_projection": false,
|
| 36 |
+
"quantization_bit": 4,
|
| 37 |
+
"rmsnorm": true,
|
| 38 |
+
"seq_length": 32768,
|
| 39 |
+
"tie_word_embeddings": false,
|
| 40 |
+
"torch_dtype": "float16",
|
| 41 |
+
"transformers_version": "4.30.2",
|
| 42 |
+
"use_cache": true,
|
| 43 |
+
"vocab_size": 65024
|
| 44 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": 2,
|
| 4 |
+
"pad_token_id": 0,
|
| 5 |
+
"transformers_version": "4.30.2"
|
| 6 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1c0c5549a20eb69634a223e8851053f549660e62ed203ea100c75f3a644102eb
|
| 3 |
+
size 3931052785
|