Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
text-generation-inference
unsloth
conversational
Instructions to use Novasy/nova-vision-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Novasy/nova-vision-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Novasy/nova-vision-7b") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Novasy/nova-vision-7b") model = AutoModelForMultimodalLM.from_pretrained("Novasy/nova-vision-7b", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Novasy/nova-vision-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Novasy/nova-vision-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Novasy/nova-vision-7b", "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/Novasy/nova-vision-7b
- SGLang
How to use Novasy/nova-vision-7b 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 "Novasy/nova-vision-7b" \ --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": "Novasy/nova-vision-7b", "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 "Novasy/nova-vision-7b" \ --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": "Novasy/nova-vision-7b", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use Novasy/nova-vision-7b with Docker Model Runner:
docker model run hf.co/Novasy/nova-vision-7b
Upload folder using huggingface_hub
Browse files- config.json +103 -101
- generation_config.json +1 -0
- model-00001-of-00004.safetensors +1 -1
- tokenizer_config.json +6 -0
config.json
CHANGED
|
@@ -1,109 +1,111 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
-
|
| 4 |
],
|
|
|
|
|
|
|
| 5 |
"torch_dtype": "bfloat16",
|
| 6 |
-
"
|
| 7 |
-
"
|
| 8 |
-
"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
"rope_parameters": {
|
| 60 |
-
"mrope_section": [
|
| 61 |
-
16,
|
| 62 |
-
24,
|
| 63 |
-
24
|
| 64 |
-
],
|
| 65 |
-
"rope_theta": 1000000.0,
|
| 66 |
-
"rope_type": "default",
|
| 67 |
-
"type": "default"
|
| 68 |
-
},
|
| 69 |
-
"sliding_window": null,
|
| 70 |
-
"use_cache": true,
|
| 71 |
-
"use_sliding_window": false,
|
| 72 |
-
"video_token_id": null,
|
| 73 |
-
"vision_end_token_id": 151653,
|
| 74 |
-
"vision_start_token_id": 151652,
|
| 75 |
-
"vision_token_id": 151654,
|
| 76 |
-
"vocab_size": 152064
|
| 77 |
-
},
|
| 78 |
-
"tie_word_embeddings": false,
|
| 79 |
-
"unsloth_fixed": true,
|
| 80 |
-
"video_token_id": 151656,
|
| 81 |
-
"vision_config": {
|
| 82 |
-
"depth": 32,
|
| 83 |
-
"torch_dtype": "bfloat16",
|
| 84 |
-
"fullatt_block_indexes": [
|
| 85 |
-
7,
|
| 86 |
-
15,
|
| 87 |
-
23,
|
| 88 |
-
31
|
| 89 |
-
],
|
| 90 |
-
"hidden_act": "silu",
|
| 91 |
-
"hidden_size": 1280,
|
| 92 |
-
"in_channels": 3,
|
| 93 |
-
"in_chans": 3,
|
| 94 |
-
"initializer_range": 0.02,
|
| 95 |
-
"intermediate_size": 3420,
|
| 96 |
-
"model_type": "qwen2_5_vl",
|
| 97 |
-
"num_heads": 16,
|
| 98 |
-
"out_hidden_size": 3584,
|
| 99 |
-
"patch_size": 14,
|
| 100 |
-
"spatial_merge_size": 2,
|
| 101 |
-
"spatial_patch_size": 14,
|
| 102 |
-
"temporal_patch_size": 2,
|
| 103 |
-
"tokens_per_second": 2,
|
| 104 |
-
"window_size": 112
|
| 105 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
"vision_end_token_id": 151653,
|
| 107 |
"vision_start_token_id": 151652,
|
| 108 |
-
"vision_token_id": 151654
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2_5_VLForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"torch_dtype": "bfloat16",
|
| 6 |
+
"image_token_id": 151655,
|
| 7 |
+
"model_type": "qwen2_5_vl",
|
| 8 |
+
"text_config": {
|
| 9 |
"architectures": [
|
| 10 |
+
"Qwen2_5_VLForConditionalGeneration"
|
| 11 |
],
|
| 12 |
+
"attention_dropout": 0.0,
|
| 13 |
+
"bos_token_id": 151643,
|
| 14 |
"torch_dtype": "bfloat16",
|
| 15 |
+
"eos_token_id": 151645,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 3584,
|
| 18 |
+
"image_token_id": null,
|
| 19 |
+
"initializer_range": 0.02,
|
| 20 |
+
"intermediate_size": 18944,
|
| 21 |
+
"layer_types": [
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention"
|
| 50 |
+
],
|
| 51 |
+
"max_position_embeddings": 128000,
|
| 52 |
+
"max_window_layers": 28,
|
| 53 |
+
"model_type": "qwen2_5_vl_text",
|
| 54 |
+
"num_attention_heads": 28,
|
| 55 |
+
"num_hidden_layers": 28,
|
| 56 |
+
"num_key_value_heads": 4,
|
| 57 |
+
"pad_token_id": null,
|
| 58 |
+
"rms_norm_eps": 1e-06,
|
| 59 |
+
"rope_parameters": {
|
| 60 |
+
"mrope_section": [
|
| 61 |
+
16,
|
| 62 |
+
24,
|
| 63 |
+
24
|
| 64 |
+
],
|
| 65 |
+
"rope_theta": 1000000.0,
|
| 66 |
+
"rope_type": "default",
|
| 67 |
+
"type": "default"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
},
|
| 69 |
+
"sliding_window": null,
|
| 70 |
+
"use_cache": true,
|
| 71 |
+
"use_sliding_window": false,
|
| 72 |
+
"video_token_id": null,
|
| 73 |
"vision_end_token_id": 151653,
|
| 74 |
"vision_start_token_id": 151652,
|
| 75 |
+
"vision_token_id": 151654,
|
| 76 |
+
"vocab_size": 152064
|
| 77 |
+
},
|
| 78 |
+
"tie_word_embeddings": false,
|
| 79 |
+
"unsloth_fixed": true,
|
| 80 |
+
"video_token_id": 151656,
|
| 81 |
+
"vision_config": {
|
| 82 |
+
"depth": 32,
|
| 83 |
+
"torch_dtype": "bfloat16",
|
| 84 |
+
"fullatt_block_indexes": [
|
| 85 |
+
7,
|
| 86 |
+
15,
|
| 87 |
+
23,
|
| 88 |
+
31
|
| 89 |
+
],
|
| 90 |
+
"hidden_act": "silu",
|
| 91 |
+
"hidden_size": 1280,
|
| 92 |
+
"in_channels": 3,
|
| 93 |
+
"in_chans": 3,
|
| 94 |
+
"initializer_range": 0.02,
|
| 95 |
+
"intermediate_size": 3420,
|
| 96 |
+
"model_type": "qwen2_5_vl",
|
| 97 |
+
"num_heads": 16,
|
| 98 |
+
"out_hidden_size": 3584,
|
| 99 |
+
"patch_size": 14,
|
| 100 |
+
"spatial_merge_size": 2,
|
| 101 |
+
"spatial_patch_size": 14,
|
| 102 |
+
"temporal_patch_size": 2,
|
| 103 |
+
"tokens_per_second": 2,
|
| 104 |
+
"window_size": 112
|
| 105 |
+
},
|
| 106 |
+
"vision_end_token_id": 151653,
|
| 107 |
+
"vision_start_token_id": 151652,
|
| 108 |
+
"vision_token_id": 151654,
|
| 109 |
+
"_name_or_path": "Novasy/nova-vision-7b",
|
| 110 |
+
"nova_brand_name": "Nova AI"
|
| 111 |
}
|
generation_config.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"do_sample": true,
|
| 3 |
"eos_token_id": [
|
|
|
|
| 4 |
151645,
|
| 5 |
151645,
|
| 6 |
151643
|
|
|
|
| 1 |
{
|
| 2 |
"do_sample": true,
|
| 3 |
"eos_token_id": [
|
| 4 |
+
151645,
|
| 5 |
151645,
|
| 6 |
151645,
|
| 7 |
151643
|
model-00001-of-00004.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4968243304
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cae5c08174bd05b1e1d96b7b56ebf4e2526d2ddd4af76e2f5a147d7928e92c78
|
| 3 |
size 4968243304
|
tokenizer_config.json
CHANGED
|
@@ -6,12 +6,18 @@
|
|
| 6 |
"eos_token": "<|im_end|>",
|
| 7 |
"errors": "replace",
|
| 8 |
"is_local": false,
|
|
|
|
| 9 |
"model_max_length": 32768,
|
|
|
|
| 10 |
"pad_token": "<|vision_pad|>",
|
|
|
|
| 11 |
"padding_side": "right",
|
| 12 |
"processor_class": "Qwen2_5_VLProcessor",
|
| 13 |
"split_special_tokens": false,
|
|
|
|
| 14 |
"tokenizer_class": "Qwen2Tokenizer",
|
|
|
|
|
|
|
| 15 |
"unk_token": null,
|
| 16 |
"added_tokens_decoder": {
|
| 17 |
"151643": {
|
|
|
|
| 6 |
"eos_token": "<|im_end|>",
|
| 7 |
"errors": "replace",
|
| 8 |
"is_local": false,
|
| 9 |
+
"max_length": 2048,
|
| 10 |
"model_max_length": 32768,
|
| 11 |
+
"pad_to_multiple_of": null,
|
| 12 |
"pad_token": "<|vision_pad|>",
|
| 13 |
+
"pad_token_type_id": 0,
|
| 14 |
"padding_side": "right",
|
| 15 |
"processor_class": "Qwen2_5_VLProcessor",
|
| 16 |
"split_special_tokens": false,
|
| 17 |
+
"stride": 0,
|
| 18 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 19 |
+
"truncation_side": "right",
|
| 20 |
+
"truncation_strategy": "longest_first",
|
| 21 |
"unk_token": null,
|
| 22 |
"added_tokens_decoder": {
|
| 23 |
"151643": {
|