Image-Text-to-Text
Transformers
Safetensors
Polish
llama
text-generation
vision
multimodal
llava
siglip
bielik
llm
conversational
text-generation-inference
Instructions to use Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct") 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 AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct") model = AutoModelForCausalLM.from_pretrained("Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct", 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 = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct", "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/Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct
- SGLang
How to use Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct 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 "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct" \ --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": "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct", "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 "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct" \ --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": "Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct", "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 Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct with Docker Model Runner:
docker model run hf.co/Wojtekb30/Bielik-1.5B-v3.0-VLM-Instruct
Move model files to root directory
Browse files- bielik_1.5b_vlm_merged/config.json +0 -35
- bielik_1.5b_vlm_merged/chat_template.jinja → chat_template.jinja +3 -3
- bielik_1.5b_vlm_merged/generation_config.json → generation_config.json +10 -10
- bielik_1.5b_vlm_merged/mm_projector.safetensors → mm_projector.safetensors +0 -0
- bielik_1.5b_vlm_merged/model.safetensors → model.safetensors +0 -0
- model_index.json +0 -13
- bielik_1.5b_vlm_merged/tokenizer.json → tokenizer.json +0 -0
- bielik_1.5b_vlm_merged/tokenizer_config.json → tokenizer_config.json +22 -22
- uruchom1.py +2 -2
- uruchom1_GUIpicker.py +2 -2
- uruchom1_fullGUI.py +2 -2
- {bielik_1.5b_vlm_merged/vision_tower_config → vision_tower_config}/config.json +38 -38
bielik_1.5b_vlm_merged/config.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"LlamaForCausalLM"
|
| 4 |
-
],
|
| 5 |
-
"attention_bias": true,
|
| 6 |
-
"attention_dropout": 0.0,
|
| 7 |
-
"bos_token_id": 1,
|
| 8 |
-
"dtype": "float16",
|
| 9 |
-
"eos_token_id": [
|
| 10 |
-
4,
|
| 11 |
-
2
|
| 12 |
-
],
|
| 13 |
-
"head_dim": 128,
|
| 14 |
-
"hidden_act": "silu",
|
| 15 |
-
"hidden_size": 1536,
|
| 16 |
-
"initializer_range": 0.02,
|
| 17 |
-
"intermediate_size": 8960,
|
| 18 |
-
"max_position_embeddings": 8192,
|
| 19 |
-
"mlp_bias": true,
|
| 20 |
-
"model_type": "llama",
|
| 21 |
-
"num_attention_heads": 12,
|
| 22 |
-
"num_hidden_layers": 32,
|
| 23 |
-
"num_key_value_heads": 2,
|
| 24 |
-
"pad_token_id": 2,
|
| 25 |
-
"pretraining_tp": 1,
|
| 26 |
-
"rms_norm_eps": 1e-06,
|
| 27 |
-
"rope_parameters": {
|
| 28 |
-
"rope_theta": 1000000,
|
| 29 |
-
"rope_type": "default"
|
| 30 |
-
},
|
| 31 |
-
"tie_word_embeddings": false,
|
| 32 |
-
"transformers_version": "5.1.0",
|
| 33 |
-
"use_cache": true,
|
| 34 |
-
"vocab_size": 32000
|
| 35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bielik_1.5b_vlm_merged/chat_template.jinja → chat_template.jinja
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
{{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
| 2 |
-
' + message['content'] + '<|im_end|>' + '
|
| 3 |
-
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 4 |
' }}{% endif %}
|
|
|
|
| 1 |
+
{{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + '
|
| 2 |
+
' + message['content'] + '<|im_end|>' + '
|
| 3 |
+
'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
|
| 4 |
' }}{% endif %}
|
bielik_1.5b_vlm_merged/generation_config.json → generation_config.json
RENAMED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_from_model_config": true,
|
| 3 |
-
"bos_token_id": 1,
|
| 4 |
-
"eos_token_id": [
|
| 5 |
-
4,
|
| 6 |
-
2
|
| 7 |
-
],
|
| 8 |
-
"pad_token_id": 2,
|
| 9 |
-
"transformers_version": "5.1.0"
|
| 10 |
-
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
4,
|
| 6 |
+
2
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 2,
|
| 9 |
+
"transformers_version": "5.1.0"
|
| 10 |
+
}
|
bielik_1.5b_vlm_merged/mm_projector.safetensors → mm_projector.safetensors
RENAMED
|
File without changes
|
bielik_1.5b_vlm_merged/model.safetensors → model.safetensors
RENAMED
|
File without changes
|
model_index.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_class_name": "LlamaForCausalLM",
|
| 3 |
-
"_transformers_version": "5.1.0",
|
| 4 |
-
"model": [
|
| 5 |
-
"transformers",
|
| 6 |
-
"LlamaForCausalLM"
|
| 7 |
-
],
|
| 8 |
-
"tokenizer": [
|
| 9 |
-
"transformers",
|
| 10 |
-
"LlamaTokenizerFast"
|
| 11 |
-
],
|
| 12 |
-
"subfolder": "bielik_1.5b_vlm_merged"
|
| 13 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bielik_1.5b_vlm_merged/tokenizer.json → tokenizer.json
RENAMED
|
File without changes
|
bielik_1.5b_vlm_merged/tokenizer_config.json → tokenizer_config.json
RENAMED
|
@@ -1,22 +1,22 @@
|
|
| 1 |
-
{
|
| 2 |
-
"add_prefix_space": null,
|
| 3 |
-
"backend": "tokenizers",
|
| 4 |
-
"bos_token": "<s>",
|
| 5 |
-
"clean_up_tokenization_spaces": false,
|
| 6 |
-
"eos_token": "<|im_end|>",
|
| 7 |
-
"extra_special_tokens": [
|
| 8 |
-
"<|im_start|>",
|
| 9 |
-
"<|im_end|>",
|
| 10 |
-
"<tool_call>",
|
| 11 |
-
"</tool_call>"
|
| 12 |
-
],
|
| 13 |
-
"is_local": true,
|
| 14 |
-
"legacy": true,
|
| 15 |
-
"model_max_length": 1000000000000000019884624838656,
|
| 16 |
-
"pad_token": "</s>",
|
| 17 |
-
"sp_model_kwargs": {},
|
| 18 |
-
"spaces_between_special_tokens": false,
|
| 19 |
-
"tokenizer_class": "TokenizersBackend",
|
| 20 |
-
"unk_token": "<unk>",
|
| 21 |
-
"use_default_system_prompt": false
|
| 22 |
-
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": null,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"extra_special_tokens": [
|
| 8 |
+
"<|im_start|>",
|
| 9 |
+
"<|im_end|>",
|
| 10 |
+
"<tool_call>",
|
| 11 |
+
"</tool_call>"
|
| 12 |
+
],
|
| 13 |
+
"is_local": true,
|
| 14 |
+
"legacy": true,
|
| 15 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 16 |
+
"pad_token": "</s>",
|
| 17 |
+
"sp_model_kwargs": {},
|
| 18 |
+
"spaces_between_special_tokens": false,
|
| 19 |
+
"tokenizer_class": "TokenizersBackend",
|
| 20 |
+
"unk_token": "<unk>",
|
| 21 |
+
"use_default_system_prompt": false
|
| 22 |
+
}
|
uruchom1.py
CHANGED
|
@@ -13,10 +13,10 @@ VISION_MODEL_PATH = "google/siglip-so400m-patch14-384"
|
|
| 13 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 14 |
|
| 15 |
# Ścieżka do scalonego modelu językowego (LLM + adaptery)
|
| 16 |
-
MERGED_MODEL_PATH = "./
|
| 17 |
|
| 18 |
# Ścieżka do pliku z wagami projektora multimodalnego
|
| 19 |
-
PROJECTOR_FILE = "./
|
| 20 |
|
| 21 |
# Automatyczny wybór urządzenia: GPU (CUDA) jeśli dostępne, w przeciwnym razie CPU
|
| 22 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 13 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 14 |
|
| 15 |
# Ścieżka do scalonego modelu językowego (LLM + adaptery)
|
| 16 |
+
MERGED_MODEL_PATH = "./"
|
| 17 |
|
| 18 |
# Ścieżka do pliku z wagami projektora multimodalnego
|
| 19 |
+
PROJECTOR_FILE = "./mm_projector.safetensors"
|
| 20 |
|
| 21 |
# Automatyczny wybór urządzenia: GPU (CUDA) jeśli dostępne, w przeciwnym razie CPU
|
| 22 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
uruchom1_GUIpicker.py
CHANGED
|
@@ -15,10 +15,10 @@ VISION_MODEL_PATH = "google/siglip-so400m-patch14-384"
|
|
| 15 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 16 |
|
| 17 |
# Ścieżka do scalonego modelu językowego (LLM + adaptery)
|
| 18 |
-
MERGED_MODEL_PATH = "./
|
| 19 |
|
| 20 |
# Ścieżka do pliku z wagami projektora multimodalnego
|
| 21 |
-
PROJECTOR_FILE = "./
|
| 22 |
|
| 23 |
# Automatyczny wybór urządzenia: GPU (CUDA) jeśli dostępne, w przeciwnym razie CPU
|
| 24 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
|
| 15 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 16 |
|
| 17 |
# Ścieżka do scalonego modelu językowego (LLM + adaptery)
|
| 18 |
+
MERGED_MODEL_PATH = "./"
|
| 19 |
|
| 20 |
# Ścieżka do pliku z wagami projektora multimodalnego
|
| 21 |
+
PROJECTOR_FILE = "./mm_projector.safetensors"
|
| 22 |
|
| 23 |
# Automatyczny wybór urządzenia: GPU (CUDA) jeśli dostępne, w przeciwnym razie CPU
|
| 24 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
uruchom1_fullGUI.py
CHANGED
|
@@ -15,8 +15,8 @@ from safetensors.torch import load_file
|
|
| 15 |
# Ścieżki / nazwy modeli
|
| 16 |
VISION_MODEL_PATH = "google/siglip-so400m-patch14-384"
|
| 17 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 18 |
-
MERGED_MODEL_PATH = "./
|
| 19 |
-
PROJECTOR_FILE = "./
|
| 20 |
|
| 21 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
|
|
|
| 15 |
# Ścieżki / nazwy modeli
|
| 16 |
VISION_MODEL_PATH = "google/siglip-so400m-patch14-384"
|
| 17 |
#VISION_MODEL_PATH = "siglip-so400m-patch14-384"
|
| 18 |
+
MERGED_MODEL_PATH = "./"
|
| 19 |
+
PROJECTOR_FILE = "./mm_projector.safetensors"
|
| 20 |
|
| 21 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
{bielik_1.5b_vlm_merged/vision_tower_config → vision_tower_config}/config.json
RENAMED
|
@@ -1,38 +1,38 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"SiglipModel"
|
| 4 |
-
],
|
| 5 |
-
"dtype": "float32",
|
| 6 |
-
"initializer_factor": 1.0,
|
| 7 |
-
"model_type": "siglip",
|
| 8 |
-
"text_config": {
|
| 9 |
-
"attention_dropout": 0.0,
|
| 10 |
-
"bos_token_id": 49406,
|
| 11 |
-
"eos_token_id": 49407,
|
| 12 |
-
"hidden_act": "gelu_pytorch_tanh",
|
| 13 |
-
"hidden_size": 1152,
|
| 14 |
-
"intermediate_size": 4304,
|
| 15 |
-
"layer_norm_eps": 1e-06,
|
| 16 |
-
"max_position_embeddings": 64,
|
| 17 |
-
"model_type": "siglip_text_model",
|
| 18 |
-
"num_attention_heads": 16,
|
| 19 |
-
"num_hidden_layers": 27,
|
| 20 |
-
"pad_token_id": 1,
|
| 21 |
-
"projection_size": 1152,
|
| 22 |
-
"vocab_size": 32000
|
| 23 |
-
},
|
| 24 |
-
"transformers_version": "5.1.0",
|
| 25 |
-
"vision_config": {
|
| 26 |
-
"attention_dropout": 0.0,
|
| 27 |
-
"hidden_act": "gelu_pytorch_tanh",
|
| 28 |
-
"hidden_size": 1152,
|
| 29 |
-
"image_size": 384,
|
| 30 |
-
"intermediate_size": 4304,
|
| 31 |
-
"layer_norm_eps": 1e-06,
|
| 32 |
-
"model_type": "siglip_vision_model",
|
| 33 |
-
"num_attention_heads": 16,
|
| 34 |
-
"num_channels": 3,
|
| 35 |
-
"num_hidden_layers": 27,
|
| 36 |
-
"patch_size": 14
|
| 37 |
-
}
|
| 38 |
-
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"SiglipModel"
|
| 4 |
+
],
|
| 5 |
+
"dtype": "float32",
|
| 6 |
+
"initializer_factor": 1.0,
|
| 7 |
+
"model_type": "siglip",
|
| 8 |
+
"text_config": {
|
| 9 |
+
"attention_dropout": 0.0,
|
| 10 |
+
"bos_token_id": 49406,
|
| 11 |
+
"eos_token_id": 49407,
|
| 12 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 13 |
+
"hidden_size": 1152,
|
| 14 |
+
"intermediate_size": 4304,
|
| 15 |
+
"layer_norm_eps": 1e-06,
|
| 16 |
+
"max_position_embeddings": 64,
|
| 17 |
+
"model_type": "siglip_text_model",
|
| 18 |
+
"num_attention_heads": 16,
|
| 19 |
+
"num_hidden_layers": 27,
|
| 20 |
+
"pad_token_id": 1,
|
| 21 |
+
"projection_size": 1152,
|
| 22 |
+
"vocab_size": 32000
|
| 23 |
+
},
|
| 24 |
+
"transformers_version": "5.1.0",
|
| 25 |
+
"vision_config": {
|
| 26 |
+
"attention_dropout": 0.0,
|
| 27 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 28 |
+
"hidden_size": 1152,
|
| 29 |
+
"image_size": 384,
|
| 30 |
+
"intermediate_size": 4304,
|
| 31 |
+
"layer_norm_eps": 1e-06,
|
| 32 |
+
"model_type": "siglip_vision_model",
|
| 33 |
+
"num_attention_heads": 16,
|
| 34 |
+
"num_channels": 3,
|
| 35 |
+
"num_hidden_layers": 27,
|
| 36 |
+
"patch_size": 14
|
| 37 |
+
}
|
| 38 |
+
}
|