sergiopaniego HF Staff commited on
Commit
045914b
·
verified ·
1 Parent(s): ad59907

Training in progress, step 10

Browse files
.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
README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/Ministral-3-3B-Instruct-2512
3
+ library_name: transformers
4
+ model_name: Ministral-3-3B-Instruct-trl-sft
5
+ tags:
6
+ - generated_from_trainer
7
+ - trl
8
+ - sft
9
+ licence: license
10
+ ---
11
+
12
+ # Model Card for Ministral-3-3B-Instruct-trl-sft
13
+
14
+ This model is a fine-tuned version of [unsloth/Ministral-3-3B-Instruct-2512](https://huggingface.co/unsloth/Ministral-3-3B-Instruct-2512).
15
+ It has been trained using [TRL](https://github.com/huggingface/trl).
16
+
17
+ ## Quick start
18
+
19
+ ```python
20
+ from transformers import pipeline
21
+
22
+ question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
+ generator = pipeline("text-generation", model="sergiopaniego/Ministral-3-3B-Instruct-trl-sft", device="cuda")
24
+ output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
+ print(output["generated_text"])
26
+ ```
27
+
28
+ ## Training procedure
29
+
30
+
31
+
32
+
33
+ This model was trained with SFT.
34
+
35
+ ### Framework versions
36
+
37
+ - TRL: 0.25.1
38
+ - Transformers: 5.0.0.dev0
39
+ - Pytorch: 2.9.0+cu126
40
+ - Datasets: 4.0.0
41
+ - Tokenizers: 0.22.1
42
+
43
+ ## Citations
44
+
45
+
46
+
47
+ Cite TRL as:
48
+
49
+ ```bibtex
50
+ @misc{vonwerra2022trl,
51
+ title = {{TRL: Transformer Reinforcement Learning}},
52
+ author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
53
+ year = 2020,
54
+ journal = {GitHub repository},
55
+ publisher = {GitHub},
56
+ howpublished = {\url{https://github.com/huggingface/trl}}
57
+ }
58
+ ```
adapter_config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": {
6
+ "base_model_class": "Mistral3ForConditionalGeneration",
7
+ "parent_library": "transformers.models.mistral3.modeling_mistral3"
8
+ },
9
+ "base_model_name_or_path": "unsloth/Ministral-3-3B-Instruct-2512",
10
+ "bias": "none",
11
+ "corda_config": null,
12
+ "ensure_weight_tying": false,
13
+ "eva_config": null,
14
+ "exclude_modules": null,
15
+ "fan_in_fan_out": false,
16
+ "inference_mode": true,
17
+ "init_lora_weights": true,
18
+ "layer_replication": null,
19
+ "layers_pattern": null,
20
+ "layers_to_transform": null,
21
+ "loftq_config": {},
22
+ "lora_alpha": 32,
23
+ "lora_bias": false,
24
+ "lora_dropout": 0.0,
25
+ "megatron_config": null,
26
+ "megatron_core": "megatron.core",
27
+ "modules_to_save": null,
28
+ "peft_type": "LORA",
29
+ "peft_version": "0.18.0",
30
+ "qalora_group_size": 16,
31
+ "r": 32,
32
+ "rank_pattern": {},
33
+ "revision": null,
34
+ "target_modules": [
35
+ "k_proj",
36
+ "q_proj",
37
+ "o_proj",
38
+ "down_proj",
39
+ "up_proj",
40
+ "v_proj",
41
+ "gate_proj"
42
+ ],
43
+ "target_parameters": null,
44
+ "task_type": null,
45
+ "trainable_token_indices": null,
46
+ "use_dora": false,
47
+ "use_qalora": false,
48
+ "use_rslora": false
49
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bbed6e55a73f9321a1789bc9f421b85d93eed89ec87af032636582d13758a22
3
+ size 270117632
chat_template.jinja ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {#- Unsloth template fixes #}
2
+ {#- Default system message if no system prompt is passed. #}
3
+ {%- set default_system_message = 'You are Ministral-3-3B-Instruct-2512, a Large Language Model (LLM) created by Mistral AI, a French startup headquartered in Paris.\nYou power an AI assistant called Le Chat.\nYour knowledge base was last updated on 2023-10-01.\nThe current date is {today}.\n\nWhen you\'re not sure about some information or when the user\'s request requires up-to-date or specific data, you must use the available tools to fetch the information. Do not hesitate to use tools whenever they can provide a more accurate or complete response. If no relevant tools are available, then clearly state that you don\'t have the information and avoid making up anything.\nIf the user\'s question is not clear, ambiguous, or does not provide enough context for you to accurately answer the question, you do not try to answer it right away and you rather ask the user to clarify their request (e.g. "What are some good restaurants around me?" => "Where are you?" or "When is the next flight to Tokyo" => "Where do you travel from?").\nYou are always very attentive to dates, in particular you try to resolve dates (e.g. "yesterday" is {yesterday}) and when asked about information at specific dates, you discard information that is at another date.\nYou follow these instructions in all languages, and always respond to the user in the language they use or request.\nNext sections describe the capabilities that you have.\n\n# WEB BROWSING INSTRUCTIONS\n\nYou cannot perform any web search or access internet to open URLs, links etc. If it seems like the user is expecting you to do so, you clarify the situation and ask the user to copy paste the text directly in the chat.\n\n# MULTI-MODAL INSTRUCTIONS\n\nYou have the ability to read images, but you cannot generate images. You also cannot transcribe audio files or videos.\nYou cannot read nor transcribe audio files or videos.\n\n# TOOL CALLING INSTRUCTIONS\n\nYou may have access to tools that you can use to fetch information or perform actions. You must use these tools in the following situations:\n\n1. When the request requires up-to-date information.\n2. When the request requires specific data that you do not have in your knowledge base.\n3. When the request involves actions that you cannot perform without tools.\n\nAlways prioritize using tools to provide the most accurate and helpful response. If tools are not available, inform the user that you cannot perform the requested action at the moment.' %}
4
+
5
+ {#- Begin of sequence token. #}
6
+ {{- bos_token }}
7
+
8
+ {#- Handle system prompt if it exists. #}
9
+ {#- System prompt supports text content or text chunks. #}
10
+ {%- if messages[0]['role'] == 'system' %}
11
+ {{- '[SYSTEM_PROMPT]' -}}
12
+ {%- if messages[0]['content'] is string %}
13
+ {{- messages[0]['content'] -}}
14
+ {%- else %}
15
+ {%- for block in messages[0]['content'] %}
16
+ {%- if block['type'] == 'text' %}
17
+ {{- block['text'] }}
18
+ {%- else %}
19
+ {{- raise_exception('Only text chunks are supported in system message contents.') }}
20
+ {%- endif %}
21
+ {%- endfor %}
22
+ {%- endif %}
23
+ {{- '[/SYSTEM_PROMPT]' -}}
24
+ {%- set loop_messages = messages[1:] %}
25
+ {%- else %}
26
+ {%- set loop_messages = messages %}
27
+ {%- if default_system_message != '' %}
28
+ {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
29
+ {%- endif %}
30
+ {%- endif %}
31
+
32
+
33
+ {#- Tools definition #}
34
+ {%- set tools_definition = '' %}
35
+ {%- set has_tools = false %}
36
+ {%- if tools is defined and tools is not none and tools|length > 0 %}
37
+ {%- set has_tools = true %}
38
+ {%- set tools_definition = '[AVAILABLE_TOOLS]' + (tools| tojson) + '[/AVAILABLE_TOOLS]' %}
39
+ {{- tools_definition }}
40
+ {%- endif %}
41
+
42
+ {#- Checks for alternating user/assistant messages. #}
43
+ {%- set ns = namespace(index=0) %}
44
+ {%- for message in loop_messages %}
45
+ {%- if message.role == 'user' or (message.role == 'assistant' and (message.tool_calls is not defined or message.tool_calls is none or message.tool_calls | length == 0)) %}
46
+ {%- if (message['role'] == 'user') != (ns.index % 2 == 0) %}
47
+ {{- raise_exception('After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.') }}
48
+ {%- endif %}
49
+ {%- set ns.index = ns.index + 1 %}
50
+ {%- endif %}
51
+ {%- endfor %}
52
+
53
+ {#- Handle conversation messages. #}
54
+ {%- for message in loop_messages %}
55
+
56
+ {#- User messages supports text content or text and image chunks. #}
57
+ {%- if message['role'] == 'user' %}
58
+ {%- if message['content'] is string %}
59
+ {{- '[INST]' + message['content'] + '[/INST]' }}
60
+ {%- elif message['content'] | length > 0 %}
61
+ {{- '[INST]' }}
62
+ {%- if message['content'] | length == 2 %}
63
+ {%- set blocks = message['content'] | sort(attribute='type') %}
64
+ {%- else %}
65
+ {%- set blocks = message['content'] %}
66
+ {%- endif %}
67
+ {%- for block in blocks %}
68
+ {%- if block['type'] == 'text' %}
69
+ {{- block['text'] }}
70
+ {%- elif block['type'] in ['image', 'image_url'] %}
71
+ {{- '[IMG]' }}
72
+ {%- else %}
73
+ {{- raise_exception('Only text, image and image_url chunks are supported in user message content.') }}
74
+ {%- endif %}
75
+ {%- endfor %}
76
+ {{- '[/INST]' }}
77
+ {%- else %}
78
+ {{- raise_exception('User message must have a string or a list of chunks in content') }}
79
+ {%- endif %}
80
+
81
+ {#- Assistant messages supports text content or text and image chunks. #}
82
+ {%- elif message['role'] == 'assistant' %}
83
+
84
+ {%- if message['content'] is string %}
85
+ {{- message['content'] }}
86
+ {%- elif message['content'] is iterable and message['content'] | length > 0 %}
87
+ {%- for block in message['content'] %}
88
+ {%- if block['type'] == 'text' %}
89
+ {{- block['text'] }}
90
+ {%- else %}
91
+ {{- raise_exception('Only text chunks are supported in assistant message contents.') }}
92
+ {%- endif %}
93
+ {%- endfor %}
94
+ {%- endif %}
95
+
96
+ {%- if message['tool_calls'] is defined and message['tool_calls'] is not none and message['tool_calls']|length > 0 %}
97
+ {%- for tool in message['tool_calls'] %}
98
+ {%- set arguments = tool['function']['arguments'] %}
99
+ {%- if arguments is not string %}
100
+ {%- set arguments = arguments|tojson|safe %}
101
+ {%- elif arguments == '' %}
102
+ {%- set arguments = '{}' %}
103
+ {%- endif %}
104
+ {{- '[TOOL_CALLS]' + tool['function']['name'] + '[ARGS]' + arguments }}
105
+ {%- endfor %}
106
+ {%- endif %}
107
+
108
+ {#- End of sequence token for each assistant messages. #}
109
+ {{- eos_token }}
110
+
111
+ {#- Tool messages only supports text content. #}
112
+ {%- elif message['role'] == 'tool' %}
113
+ {{- '[TOOL_RESULTS]' + message['content']|string + '[/TOOL_RESULTS]' }}
114
+
115
+ {#- Raise exception for unsupported roles. #}
116
+ {%- else %}
117
+ {{- raise_exception('Only user, assistant and tool roles are supported, got ' + message['role']) }}
118
+ {%- endif %}
119
+ {%- endfor %}
120
+
121
+ {#- Copyright 2025-present Unsloth. Apache 2.0 License. #}
processor_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_break_token": "[IMG_BREAK]",
3
+ "image_end_token": "[IMG_END]",
4
+ "image_processor": {
5
+ "crop_size": null,
6
+ "data_format": "channels_first",
7
+ "device": null,
8
+ "disable_grouping": null,
9
+ "do_center_crop": null,
10
+ "do_convert_rgb": true,
11
+ "do_normalize": true,
12
+ "do_pad": null,
13
+ "do_rescale": true,
14
+ "do_resize": true,
15
+ "image_mean": [
16
+ 0.48145466,
17
+ 0.4578275,
18
+ 0.40821073
19
+ ],
20
+ "image_processor_type": "PixtralImageProcessorFast",
21
+ "image_seq_length": null,
22
+ "image_std": [
23
+ 0.26862954,
24
+ 0.26130258,
25
+ 0.27577711
26
+ ],
27
+ "input_data_format": null,
28
+ "pad_size": null,
29
+ "patch_size": 14,
30
+ "processor_class": "PixtralProcessor",
31
+ "resample": 3,
32
+ "rescale_factor": 0.00392156862745098,
33
+ "return_tensors": null,
34
+ "size": {
35
+ "longest_edge": 1540
36
+ }
37
+ },
38
+ "image_token": "[IMG]",
39
+ "patch_size": 14,
40
+ "processor_class": "PixtralProcessor",
41
+ "spatial_merge_size": 2
42
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a86da3c499612f2a3f658700f3eee7fdec8212716a61ce97305f6dd5c885f1e
3
+ size 17078266
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff
 
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:125eeab98f1db10dda01562033196224e1036f64b69bf0cea06a61583f6858c3
3
+ size 5585