Instructions to use internlm/Intern-S1-Pro-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use internlm/Intern-S1-Pro-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="internlm/Intern-S1-Pro-BF16", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("internlm/Intern-S1-Pro-BF16", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use internlm/Intern-S1-Pro-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "internlm/Intern-S1-Pro-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "internlm/Intern-S1-Pro-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/internlm/Intern-S1-Pro-BF16
- SGLang
How to use internlm/Intern-S1-Pro-BF16 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 "internlm/Intern-S1-Pro-BF16" \ --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": "internlm/Intern-S1-Pro-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "internlm/Intern-S1-Pro-BF16" \ --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": "internlm/Intern-S1-Pro-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use internlm/Intern-S1-Pro-BF16 with Docker Model Runner:
docker model run hf.co/internlm/Intern-S1-Pro-BF16
Upload config.json
Browse files- config.json +97 -0
config.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"InternS1ProForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"image_token_id": 151655,
|
| 6 |
+
"model_type": "interns1_pro",
|
| 7 |
+
"text_config": {
|
| 8 |
+
"attention_bias": false,
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"bos_token_id": 151643,
|
| 11 |
+
"decoder_sparse_step": 1,
|
| 12 |
+
"dtype": "bfloat16",
|
| 13 |
+
"eos_token_id": 151645,
|
| 14 |
+
"head_dim": 128,
|
| 15 |
+
"hidden_act": "silu",
|
| 16 |
+
"hidden_size": 4096,
|
| 17 |
+
"initializer_range": 0.02,
|
| 18 |
+
"intermediate_size": 12288,
|
| 19 |
+
"max_position_embeddings": 262144,
|
| 20 |
+
"mlp_only_layers": [],
|
| 21 |
+
"model_type": "interns1_pro_text",
|
| 22 |
+
"moe_intermediate_size": 1536,
|
| 23 |
+
"norm_topk_prob": true,
|
| 24 |
+
"num_attention_heads": 64,
|
| 25 |
+
"num_experts": 512,
|
| 26 |
+
"num_experts_per_tok": 8,
|
| 27 |
+
"num_hidden_layers": 94,
|
| 28 |
+
"num_key_value_heads": 4,
|
| 29 |
+
"rms_norm_eps": 1e-06,
|
| 30 |
+
"rope_scaling": {
|
| 31 |
+
"rope_type": "default",
|
| 32 |
+
"fope_init_factor": 0.5,
|
| 33 |
+
"fope_sep_head": true,
|
| 34 |
+
"num_inv_freq": null
|
| 35 |
+
},
|
| 36 |
+
"rope_theta": 5000000,
|
| 37 |
+
"router_n_groups": 8,
|
| 38 |
+
"use_cache": true,
|
| 39 |
+
"vocab_size": 155008
|
| 40 |
+
},
|
| 41 |
+
"tie_word_embeddings": false,
|
| 42 |
+
"transformers_version": "4.57.0.dev0",
|
| 43 |
+
"video_token_id": 151656,
|
| 44 |
+
"vision_config": {
|
| 45 |
+
"depth": 24,
|
| 46 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 47 |
+
"hidden_size": 1024,
|
| 48 |
+
"in_channels": 3,
|
| 49 |
+
"initializer_range": 0.02,
|
| 50 |
+
"intermediate_size": 4096,
|
| 51 |
+
"model_type": "interns1_pro_vision",
|
| 52 |
+
"num_heads": 16,
|
| 53 |
+
"num_position_embeddings": 2304,
|
| 54 |
+
"out_hidden_size": 4096,
|
| 55 |
+
"patch_size": 16,
|
| 56 |
+
"spatial_merge_size": 2,
|
| 57 |
+
"temporal_patch_size": 2
|
| 58 |
+
},
|
| 59 |
+
"vision_end_token_id": 151653,
|
| 60 |
+
"vision_start_token_id": 151652,
|
| 61 |
+
"ts_config": {
|
| 62 |
+
"auto_map": {
|
| 63 |
+
"AutoConfig": "configuration_interns1_pro.InternS1ProTimeSeriesConfig",
|
| 64 |
+
"AutoModel": "modeling_interns1_pro.InternS1ProTimeSeriesModel"
|
| 65 |
+
},
|
| 66 |
+
"activation_dropout": 0.0,
|
| 67 |
+
"activation_function": "gelu",
|
| 68 |
+
"architectures": [
|
| 69 |
+
"InternS1TimeSeriesModel"
|
| 70 |
+
],
|
| 71 |
+
"attention_dropout": 0.0,
|
| 72 |
+
"d_model": 768,
|
| 73 |
+
"dropout": 0.0,
|
| 74 |
+
"dtype": "bfloat16",
|
| 75 |
+
"encoder_attention_heads": 8,
|
| 76 |
+
"encoder_ffn_dim": 3072,
|
| 77 |
+
"encoder_layerdrop": 0.0,
|
| 78 |
+
"encoder_layers": 17,
|
| 79 |
+
"model_type": "interns1_pro_time_series",
|
| 80 |
+
"max_source_positions": 1500,
|
| 81 |
+
"num_mel_bins": 80,
|
| 82 |
+
"out_hidden_size": 4096,
|
| 83 |
+
"scale_embedding": false,
|
| 84 |
+
"ts_adapt_in_dim": 256,
|
| 85 |
+
"ts_adapt_out_dim": 1024,
|
| 86 |
+
"use_cache": true,
|
| 87 |
+
"attn_implementation": "eager"
|
| 88 |
+
},
|
| 89 |
+
"ts_end_id": 151684,
|
| 90 |
+
"ts_start_id": 151683,
|
| 91 |
+
"ts_token_id": 151685,
|
| 92 |
+
"auto_map": {
|
| 93 |
+
"AutoConfig": "configuration_interns1_pro.InternS1ProConfig",
|
| 94 |
+
"AutoModel": "modeling_interns1_pro.InternS1ProModel",
|
| 95 |
+
"AutoModelForCausalLM": "modeling_interns1_pro.InternS1ProForConditionalGeneration"
|
| 96 |
+
}
|
| 97 |
+
}
|