Instructions to use Skywork/Skywork-R1V2-38B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Skywork/Skywork-R1V2-38B-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Skywork/Skywork-R1V2-38B-AWQ", 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 AutoModel model = AutoModel.from_pretrained("Skywork/Skywork-R1V2-38B-AWQ", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Skywork/Skywork-R1V2-38B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Skywork/Skywork-R1V2-38B-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Skywork/Skywork-R1V2-38B-AWQ", "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/Skywork/Skywork-R1V2-38B-AWQ
- SGLang
How to use Skywork/Skywork-R1V2-38B-AWQ 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 "Skywork/Skywork-R1V2-38B-AWQ" \ --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": "Skywork/Skywork-R1V2-38B-AWQ", "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 "Skywork/Skywork-R1V2-38B-AWQ" \ --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": "Skywork/Skywork-R1V2-38B-AWQ", "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 Skywork/Skywork-R1V2-38B-AWQ with Docker Model Runner:
docker model run hf.co/Skywork/Skywork-R1V2-38B-AWQ
Delete .ipynb_checkpoints
Browse files
.ipynb_checkpoints/config-checkpoint.json
DELETED
|
@@ -1,211 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_commit_hash": null,
|
| 3 |
-
"architectures": [
|
| 4 |
-
"SkyworkChatModel"
|
| 5 |
-
],
|
| 6 |
-
"auto_map": {
|
| 7 |
-
"AutoConfig": "configuration_skywork_chat.SkyworkChatConfig",
|
| 8 |
-
"AutoModel": "modeling_skywork_chat.SkyworkChatModel",
|
| 9 |
-
"AutoModelForCausalLM": "modeling_skywork_chat.SkyworkChatModel"
|
| 10 |
-
},
|
| 11 |
-
"downsample_ratio": 0.5,
|
| 12 |
-
"dynamic_image_size": true,
|
| 13 |
-
"force_image_size": 448,
|
| 14 |
-
"hidden_size": 5120,
|
| 15 |
-
"llm_config": {
|
| 16 |
-
"_attn_implementation_autoset": true,
|
| 17 |
-
"_name_or_path": "",
|
| 18 |
-
"add_cross_attention": false,
|
| 19 |
-
"architectures": [
|
| 20 |
-
"Qwen2ForCausalLM"
|
| 21 |
-
],
|
| 22 |
-
"attention_dropout": 0.0,
|
| 23 |
-
"attn_implementation": "flash_attention_2",
|
| 24 |
-
"auto_map": {
|
| 25 |
-
"AutoConfig": "configuration_skywork_chat.SkyworkChatConfig",
|
| 26 |
-
"AutoModel": "modeling_skywork_chat.SkyworkChatModel",
|
| 27 |
-
"AutoModelForCausalLM": "modeling_skywork_chat.SkyworkChatModel",
|
| 28 |
-
"AutoModelForSequenceClassification": "modeling_skywork_lm2.SkyworkLM2ForSequenceClassification"
|
| 29 |
-
},
|
| 30 |
-
"bad_words_ids": null,
|
| 31 |
-
"begin_suppress_tokens": null,
|
| 32 |
-
"bos_token_id": 151643,
|
| 33 |
-
"chunk_size_feed_forward": 0,
|
| 34 |
-
"cross_attention_hidden_size": null,
|
| 35 |
-
"decoder_start_token_id": null,
|
| 36 |
-
"diversity_penalty": 0.0,
|
| 37 |
-
"do_sample": false,
|
| 38 |
-
"early_stopping": false,
|
| 39 |
-
"encoder_no_repeat_ngram_size": 0,
|
| 40 |
-
"eos_token_id": 151643,
|
| 41 |
-
"exponential_decay_length_penalty": null,
|
| 42 |
-
"finetuning_task": null,
|
| 43 |
-
"forced_bos_token_id": null,
|
| 44 |
-
"forced_eos_token_id": null,
|
| 45 |
-
"hidden_act": "silu",
|
| 46 |
-
"hidden_size": 5120,
|
| 47 |
-
"id2label": {
|
| 48 |
-
"0": "LABEL_0",
|
| 49 |
-
"1": "LABEL_1"
|
| 50 |
-
},
|
| 51 |
-
"initializer_range": 0.02,
|
| 52 |
-
"intermediate_size": 27648,
|
| 53 |
-
"is_decoder": false,
|
| 54 |
-
"is_encoder_decoder": false,
|
| 55 |
-
"label2id": {
|
| 56 |
-
"LABEL_0": 0,
|
| 57 |
-
"LABEL_1": 1
|
| 58 |
-
},
|
| 59 |
-
"length_penalty": 1.0,
|
| 60 |
-
"max_length": 20,
|
| 61 |
-
"max_position_embeddings": 40960,
|
| 62 |
-
"max_window_layers": 64,
|
| 63 |
-
"min_length": 0,
|
| 64 |
-
"model_type": "qwen2",
|
| 65 |
-
"no_repeat_ngram_size": 0,
|
| 66 |
-
"num_attention_heads": 40,
|
| 67 |
-
"num_beam_groups": 1,
|
| 68 |
-
"num_beams": 1,
|
| 69 |
-
"num_hidden_layers": 64,
|
| 70 |
-
"num_key_value_heads": 8,
|
| 71 |
-
"num_return_sequences": 1,
|
| 72 |
-
"output_attentions": false,
|
| 73 |
-
"output_hidden_states": false,
|
| 74 |
-
"output_scores": false,
|
| 75 |
-
"pad_token_id": null,
|
| 76 |
-
"prefix": null,
|
| 77 |
-
"problem_type": null,
|
| 78 |
-
"pruned_heads": {},
|
| 79 |
-
"quantization_config": {
|
| 80 |
-
"bits": 4,
|
| 81 |
-
"group_size": 128,
|
| 82 |
-
"quant_method": "awq",
|
| 83 |
-
"version": "gemm",
|
| 84 |
-
"zero_point": true
|
| 85 |
-
},
|
| 86 |
-
"remove_invalid_values": false,
|
| 87 |
-
"repetition_penalty": 1.0,
|
| 88 |
-
"return_dict": true,
|
| 89 |
-
"return_dict_in_generate": false,
|
| 90 |
-
"rms_norm_eps": 1e-05,
|
| 91 |
-
"rope_scaling": null,
|
| 92 |
-
"rope_theta": 1000000.0,
|
| 93 |
-
"sep_token_id": null,
|
| 94 |
-
"sliding_window": null,
|
| 95 |
-
"suppress_tokens": null,
|
| 96 |
-
"task_specific_params": null,
|
| 97 |
-
"temperature": 1.0,
|
| 98 |
-
"tf_legacy_loss": false,
|
| 99 |
-
"tie_encoder_decoder": false,
|
| 100 |
-
"tie_word_embeddings": false,
|
| 101 |
-
"tokenizer_class": null,
|
| 102 |
-
"top_k": 50,
|
| 103 |
-
"top_p": 1.0,
|
| 104 |
-
"torch_dtype": "bfloat16",
|
| 105 |
-
"torchscript": false,
|
| 106 |
-
"transformers_version": "4.50.0",
|
| 107 |
-
"typical_p": 1.0,
|
| 108 |
-
"use_bfloat16": false,
|
| 109 |
-
"use_cache": false,
|
| 110 |
-
"use_sliding_window": false,
|
| 111 |
-
"vocab_size": 152064
|
| 112 |
-
},
|
| 113 |
-
"max_dynamic_patch": 12,
|
| 114 |
-
"min_dynamic_patch": 1,
|
| 115 |
-
"model_type": "skywork_chat",
|
| 116 |
-
"pad2square": false,
|
| 117 |
-
"ps_version": "v2",
|
| 118 |
-
"select_layer": -1,
|
| 119 |
-
"template": "skywork-r1v-chat",
|
| 120 |
-
"tie_word_embeddings": false,
|
| 121 |
-
"torch_dtype": "float16",
|
| 122 |
-
"transformers_version": null,
|
| 123 |
-
"use_backbone_lora": 0,
|
| 124 |
-
"use_llm_lora": 0,
|
| 125 |
-
"use_thumbnail": true,
|
| 126 |
-
"vision_config": {
|
| 127 |
-
"_attn_implementation_autoset": true,
|
| 128 |
-
"_name_or_path": "",
|
| 129 |
-
"add_cross_attention": false,
|
| 130 |
-
"architectures": [
|
| 131 |
-
"InternVisionModel"
|
| 132 |
-
],
|
| 133 |
-
"attention_dropout": 0.0,
|
| 134 |
-
"bad_words_ids": null,
|
| 135 |
-
"begin_suppress_tokens": null,
|
| 136 |
-
"bos_token_id": null,
|
| 137 |
-
"chunk_size_feed_forward": 0,
|
| 138 |
-
"cross_attention_hidden_size": null,
|
| 139 |
-
"decoder_start_token_id": null,
|
| 140 |
-
"diversity_penalty": 0.0,
|
| 141 |
-
"do_sample": false,
|
| 142 |
-
"drop_path_rate": 0.4,
|
| 143 |
-
"dropout": 0.0,
|
| 144 |
-
"early_stopping": false,
|
| 145 |
-
"encoder_no_repeat_ngram_size": 0,
|
| 146 |
-
"eos_token_id": null,
|
| 147 |
-
"exponential_decay_length_penalty": null,
|
| 148 |
-
"finetuning_task": null,
|
| 149 |
-
"forced_bos_token_id": null,
|
| 150 |
-
"forced_eos_token_id": null,
|
| 151 |
-
"hidden_act": "gelu",
|
| 152 |
-
"hidden_size": 3200,
|
| 153 |
-
"id2label": {
|
| 154 |
-
"0": "LABEL_0",
|
| 155 |
-
"1": "LABEL_1"
|
| 156 |
-
},
|
| 157 |
-
"image_size": 448,
|
| 158 |
-
"initializer_factor": 0.1,
|
| 159 |
-
"initializer_range": 1e-10,
|
| 160 |
-
"intermediate_size": 12800,
|
| 161 |
-
"is_decoder": false,
|
| 162 |
-
"is_encoder_decoder": false,
|
| 163 |
-
"label2id": {
|
| 164 |
-
"LABEL_0": 0,
|
| 165 |
-
"LABEL_1": 1
|
| 166 |
-
},
|
| 167 |
-
"layer_norm_eps": 1e-06,
|
| 168 |
-
"length_penalty": 1.0,
|
| 169 |
-
"max_length": 20,
|
| 170 |
-
"min_length": 0,
|
| 171 |
-
"model_type": "",
|
| 172 |
-
"no_repeat_ngram_size": 0,
|
| 173 |
-
"norm_type": "rms_norm",
|
| 174 |
-
"num_attention_heads": 25,
|
| 175 |
-
"num_beam_groups": 1,
|
| 176 |
-
"num_beams": 1,
|
| 177 |
-
"num_channels": 3,
|
| 178 |
-
"num_hidden_layers": 45,
|
| 179 |
-
"num_return_sequences": 1,
|
| 180 |
-
"output_attentions": false,
|
| 181 |
-
"output_hidden_states": false,
|
| 182 |
-
"output_scores": false,
|
| 183 |
-
"pad_token_id": null,
|
| 184 |
-
"patch_size": 14,
|
| 185 |
-
"prefix": null,
|
| 186 |
-
"problem_type": null,
|
| 187 |
-
"pruned_heads": {},
|
| 188 |
-
"qk_normalization": true,
|
| 189 |
-
"qkv_bias": false,
|
| 190 |
-
"remove_invalid_values": false,
|
| 191 |
-
"repetition_penalty": 1.0,
|
| 192 |
-
"return_dict": true,
|
| 193 |
-
"return_dict_in_generate": false,
|
| 194 |
-
"sep_token_id": null,
|
| 195 |
-
"suppress_tokens": null,
|
| 196 |
-
"task_specific_params": null,
|
| 197 |
-
"temperature": 1.0,
|
| 198 |
-
"tf_legacy_loss": false,
|
| 199 |
-
"tie_encoder_decoder": false,
|
| 200 |
-
"tie_word_embeddings": true,
|
| 201 |
-
"tokenizer_class": null,
|
| 202 |
-
"top_k": 50,
|
| 203 |
-
"top_p":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