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 Settings
- 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
| { | |
| "architectures": [ | |
| "InternS1ProForConditionalGeneration" | |
| ], | |
| "image_token_id": 151655, | |
| "model_type": "interns1_pro", | |
| "text_config": { | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 151643, | |
| "decoder_sparse_step": 1, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 12288, | |
| "max_position_embeddings": 262144, | |
| "mlp_only_layers": [], | |
| "model_type": "interns1_pro_text", | |
| "moe_intermediate_size": 1536, | |
| "norm_topk_prob": true, | |
| "num_attention_heads": 64, | |
| "num_experts": 512, | |
| "num_experts_per_tok": 8, | |
| "num_hidden_layers": 94, | |
| "num_key_value_heads": 4, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": { | |
| "rope_type": "default", | |
| "fope_init_factor": 0.5, | |
| "fope_sep_head": true, | |
| "num_inv_freq": null | |
| }, | |
| "rope_theta": 5000000, | |
| "router_n_groups": 8, | |
| "use_cache": true, | |
| "vocab_size": 155008 | |
| }, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "4.57.0.dev0", | |
| "video_token_id": 151656, | |
| "vision_config": { | |
| "depth": 24, | |
| "hidden_act": "gelu_pytorch_tanh", | |
| "hidden_size": 1024, | |
| "in_channels": 3, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "model_type": "interns1_pro_vision", | |
| "num_heads": 16, | |
| "num_position_embeddings": 2304, | |
| "out_hidden_size": 4096, | |
| "patch_size": 16, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2 | |
| }, | |
| "vision_end_token_id": 151653, | |
| "vision_start_token_id": 151652, | |
| "ts_config": { | |
| "auto_map": { | |
| "AutoConfig": "configuration_interns1_pro.InternS1ProTimeSeriesConfig", | |
| "AutoModel": "modeling_interns1_pro.InternS1ProTimeSeriesModel" | |
| }, | |
| "activation_dropout": 0.0, | |
| "activation_function": "gelu", | |
| "architectures": [ | |
| "InternS1TimeSeriesModel" | |
| ], | |
| "attention_dropout": 0.0, | |
| "d_model": 768, | |
| "dropout": 0.0, | |
| "dtype": "bfloat16", | |
| "encoder_attention_heads": 8, | |
| "encoder_ffn_dim": 3072, | |
| "encoder_layerdrop": 0.0, | |
| "encoder_layers": 17, | |
| "model_type": "interns1_pro_time_series", | |
| "max_source_positions": 1500, | |
| "num_mel_bins": 80, | |
| "out_hidden_size": 4096, | |
| "scale_embedding": false, | |
| "ts_adapt_in_dim": 256, | |
| "ts_adapt_out_dim": 1024, | |
| "use_cache": true, | |
| "attn_implementation": "eager" | |
| }, | |
| "ts_end_id": 151684, | |
| "ts_start_id": 151683, | |
| "ts_token_id": 151685, | |
| "auto_map": { | |
| "AutoConfig": "configuration_interns1_pro.InternS1ProConfig", | |
| "AutoModel": "modeling_interns1_pro.InternS1ProModel", | |
| "AutoModelForCausalLM": "modeling_interns1_pro.InternS1ProForConditionalGeneration" | |
| } | |
| } | |