Image-Text-to-Text
Transformers
Safetensors
English
mistral3
text-generation-inference
unsloth
conversational
Instructions to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="hnuka/BEST-Ministral-8B-DFK-Base-Sharded") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("hnuka/BEST-Ministral-8B-DFK-Base-Sharded") model = AutoModelForMultimodalLM.from_pretrained("hnuka/BEST-Ministral-8B-DFK-Base-Sharded") 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hnuka/BEST-Ministral-8B-DFK-Base-Sharded" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hnuka/BEST-Ministral-8B-DFK-Base-Sharded", "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/hnuka/BEST-Ministral-8B-DFK-Base-Sharded
- SGLang
How to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded 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 "hnuka/BEST-Ministral-8B-DFK-Base-Sharded" \ --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": "hnuka/BEST-Ministral-8B-DFK-Base-Sharded", "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 "hnuka/BEST-Ministral-8B-DFK-Base-Sharded" \ --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": "hnuka/BEST-Ministral-8B-DFK-Base-Sharded", "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 Studio
How to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hnuka/BEST-Ministral-8B-DFK-Base-Sharded to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hnuka/BEST-Ministral-8B-DFK-Base-Sharded to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for hnuka/BEST-Ministral-8B-DFK-Base-Sharded to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="hnuka/BEST-Ministral-8B-DFK-Base-Sharded", max_seq_length=2048, ) - Docker Model Runner
How to use hnuka/BEST-Ministral-8B-DFK-Base-Sharded with Docker Model Runner:
docker model run hf.co/hnuka/BEST-Ministral-8B-DFK-Base-Sharded
(Trained with Unsloth)
Browse files- .gitattributes +1 -0
- chat_template.jinja +17 -0
- config.json +73 -0
- generation_config.json +7 -0
- processor_config.json +32 -0
- tokenizer.json +3 -0
- tokenizer_config.json +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{#- Begin of sequence token. -#}
|
| 2 |
+
{{- bos_token }}
|
| 3 |
+
{#- Handle system prompt jika ada. -#}
|
| 4 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 5 |
+
{{- '[SYSTEM_PROMPT]' + messages[0]['content'] + '[/SYSTEM_PROMPT]' }}
|
| 6 |
+
{%- set loop_messages = messages[1:] %}
|
| 7 |
+
{%- else %}
|
| 8 |
+
{%- set loop_messages = messages %}
|
| 9 |
+
{%- endif %}
|
| 10 |
+
{#- Handle iterasi untuk User dan Assistant -#}
|
| 11 |
+
{%- for message in loop_messages %}
|
| 12 |
+
{%- if message['role'] == 'user' %}
|
| 13 |
+
{{- '[INST]' + message['content'] + '[/INST]' }}
|
| 14 |
+
{%- elif message['role'] == 'assistant' %}
|
| 15 |
+
{{- message['content'] + eos_token }}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- endfor %}
|
config.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Mistral3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"bos_token_id": 1,
|
| 6 |
+
"torch_dtype": "bfloat16",
|
| 7 |
+
"eos_token_id": 2,
|
| 8 |
+
"image_token_index": 10,
|
| 9 |
+
"model_name": "unsloth/ministral-3-8b-base-2512-unsloth-bnb-4bit",
|
| 10 |
+
"model_type": "mistral3",
|
| 11 |
+
"multimodal_projector_bias": false,
|
| 12 |
+
"pad_token_id": 11,
|
| 13 |
+
"projector_hidden_act": "gelu",
|
| 14 |
+
"spatial_merge_size": 2,
|
| 15 |
+
"text_config": {
|
| 16 |
+
"attention_dropout": 0.0,
|
| 17 |
+
"bos_token_id": 1,
|
| 18 |
+
"torch_dtype": "bfloat16",
|
| 19 |
+
"eos_token_id": 2,
|
| 20 |
+
"head_dim": 128,
|
| 21 |
+
"hidden_act": "silu",
|
| 22 |
+
"hidden_size": 4096,
|
| 23 |
+
"initializer_range": 0.02,
|
| 24 |
+
"intermediate_size": 14336,
|
| 25 |
+
"max_position_embeddings": 262144,
|
| 26 |
+
"model_type": "ministral3",
|
| 27 |
+
"num_attention_heads": 32,
|
| 28 |
+
"num_hidden_layers": 34,
|
| 29 |
+
"num_key_value_heads": 8,
|
| 30 |
+
"pad_token_id": 11,
|
| 31 |
+
"rms_norm_eps": 1e-05,
|
| 32 |
+
"rope_parameters": {
|
| 33 |
+
"beta_fast": 32.0,
|
| 34 |
+
"beta_slow": 1.0,
|
| 35 |
+
"factor": 16.0,
|
| 36 |
+
"llama_4_scaling_beta": 0.1,
|
| 37 |
+
"mscale": 1.0,
|
| 38 |
+
"mscale_all_dim": 1.0,
|
| 39 |
+
"original_max_position_embeddings": 16384,
|
| 40 |
+
"rope_theta": 1000000.0,
|
| 41 |
+
"rope_type": "yarn",
|
| 42 |
+
"type": "yarn"
|
| 43 |
+
},
|
| 44 |
+
"sliding_window": null,
|
| 45 |
+
"tie_word_embeddings": false,
|
| 46 |
+
"use_cache": true,
|
| 47 |
+
"vocab_size": 131072
|
| 48 |
+
},
|
| 49 |
+
"tie_word_embeddings": false,
|
| 50 |
+
"unsloth_fixed": true,
|
| 51 |
+
"unsloth_version": "2026.6.1",
|
| 52 |
+
"use_cache": false,
|
| 53 |
+
"vision_config": {
|
| 54 |
+
"attention_dropout": 0.0,
|
| 55 |
+
"torch_dtype": "bfloat16",
|
| 56 |
+
"head_dim": 64,
|
| 57 |
+
"hidden_act": "silu",
|
| 58 |
+
"hidden_size": 1024,
|
| 59 |
+
"image_size": 1540,
|
| 60 |
+
"initializer_range": 0.02,
|
| 61 |
+
"intermediate_size": 4096,
|
| 62 |
+
"model_type": "pixtral",
|
| 63 |
+
"num_attention_heads": 16,
|
| 64 |
+
"num_channels": 3,
|
| 65 |
+
"num_hidden_layers": 24,
|
| 66 |
+
"patch_size": 14,
|
| 67 |
+
"rope_parameters": {
|
| 68 |
+
"rope_theta": 10000.0,
|
| 69 |
+
"rope_type": "default"
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
"vision_feature_layer": -1
|
| 73 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 1,
|
| 3 |
+
"eos_token_id": 2,
|
| 4 |
+
"max_length": 262144,
|
| 5 |
+
"pad_token_id": 11,
|
| 6 |
+
"transformers_version": "5.5.0"
|
| 7 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_break_token": "[IMG_BREAK]",
|
| 3 |
+
"image_end_token": "[IMG_END]",
|
| 4 |
+
"image_processor": {
|
| 5 |
+
"data_format": "channels_first",
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.48145466,
|
| 12 |
+
0.4578275,
|
| 13 |
+
0.40821073
|
| 14 |
+
],
|
| 15 |
+
"image_processor_type": "PixtralImageProcessor",
|
| 16 |
+
"image_std": [
|
| 17 |
+
0.26862954,
|
| 18 |
+
0.26130258,
|
| 19 |
+
0.27577711
|
| 20 |
+
],
|
| 21 |
+
"patch_size": 14,
|
| 22 |
+
"resample": 3,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"size": {
|
| 25 |
+
"longest_edge": 1540
|
| 26 |
+
}
|
| 27 |
+
},
|
| 28 |
+
"image_token": "[IMG]",
|
| 29 |
+
"patch_size": 14,
|
| 30 |
+
"processor_class": "PixtralProcessor",
|
| 31 |
+
"spatial_merge_size": 2
|
| 32 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:06dfd962d16c039a3b55b7a02f88040b252b0e8d68516a3324b24febcfff721a
|
| 3 |
+
size 17078364
|
tokenizer_config.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|