batouln/gemma3_adapters
Browse files- README.md +41 -42
- adapter_config.json +8 -8
- adapter_model.safetensors +2 -2
- added_tokens.json +1 -26
- chat_template.jinja +47 -5
- preprocessor_config.json +29 -0
- processor_config.json +4 -0
- special_tokens_map.json +4 -5
- tokenizer.json +2 -2
- tokenizer.model +3 -0
- tokenizer_config.json +0 -0
- training_args.bin +2 -2
README.md
CHANGED
|
@@ -1,60 +1,59 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
tags:
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
- name: outputs
|
| 12 |
-
results: []
|
| 13 |
---
|
| 14 |
|
| 15 |
-
|
| 16 |
-
should probably proofread and complete it, then remove this comment. -->
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
|
|
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
##
|
| 27 |
-
|
| 28 |
-
More information needed
|
| 29 |
-
|
| 30 |
-
## Training and evaluation data
|
| 31 |
|
| 32 |
-
|
| 33 |
|
| 34 |
-
## Training procedure
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
-
- learning_rate: 0.0002
|
| 40 |
-
- train_batch_size: 2
|
| 41 |
-
- eval_batch_size: 8
|
| 42 |
-
- seed: 3407
|
| 43 |
-
- gradient_accumulation_steps: 4
|
| 44 |
-
- total_train_batch_size: 8
|
| 45 |
-
- optimizer: Use adamw_8bit with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 46 |
-
- lr_scheduler_type: linear
|
| 47 |
-
- lr_scheduler_warmup_steps: 5
|
| 48 |
-
- training_steps: 700
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
|
|
|
| 52 |
|
| 53 |
|
| 54 |
-
### Framework versions
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/gemma-3-27b-it-unsloth-bnb-4bit
|
| 3 |
+
library_name: transformers
|
| 4 |
+
model_name: outputs
|
| 5 |
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
- sft
|
| 8 |
+
- unsloth
|
| 9 |
+
- trl
|
| 10 |
+
licence: license
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Model Card for outputs
|
|
|
|
| 14 |
|
| 15 |
+
This model is a fine-tuned version of [unsloth/gemma-3-27b-it-unsloth-bnb-4bit](https://huggingface.co/unsloth/gemma-3-27b-it-unsloth-bnb-4bit).
|
| 16 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 17 |
|
| 18 |
+
## Quick start
|
| 19 |
|
| 20 |
+
```python
|
| 21 |
+
from transformers import pipeline
|
| 22 |
|
| 23 |
+
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?"
|
| 24 |
+
generator = pipeline("text-generation", model="batoulnn/outputs", device="cuda")
|
| 25 |
+
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 26 |
+
print(output["generated_text"])
|
| 27 |
+
```
|
| 28 |
|
| 29 |
+
## Training procedure
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
|
| 32 |
|
|
|
|
| 33 |
|
| 34 |
+
This model was trained with SFT.
|
| 35 |
|
| 36 |
+
### Framework versions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
- TRL: 0.19.1
|
| 39 |
+
- Transformers: 4.53.2
|
| 40 |
+
- Pytorch: 2.7.1
|
| 41 |
+
- Datasets: 3.6.0
|
| 42 |
+
- Tokenizers: 0.21.2
|
| 43 |
|
| 44 |
+
## Citations
|
| 45 |
|
| 46 |
|
|
|
|
| 47 |
|
| 48 |
+
Cite TRL as:
|
| 49 |
+
|
| 50 |
+
```bibtex
|
| 51 |
+
@misc{vonwerra2022trl,
|
| 52 |
+
title = {{TRL: Transformer Reinforcement Learning}},
|
| 53 |
+
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},
|
| 54 |
+
year = 2020,
|
| 55 |
+
journal = {GitHub repository},
|
| 56 |
+
publisher = {GitHub},
|
| 57 |
+
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 58 |
+
}
|
| 59 |
+
```
|
adapter_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"alpha_pattern": {},
|
| 3 |
"auto_mapping": null,
|
| 4 |
-
"base_model_name_or_path": "
|
| 5 |
"bias": "none",
|
| 6 |
"corda_config": null,
|
| 7 |
"eva_config": null,
|
|
@@ -13,24 +13,24 @@
|
|
| 13 |
"layers_pattern": null,
|
| 14 |
"layers_to_transform": null,
|
| 15 |
"loftq_config": {},
|
| 16 |
-
"lora_alpha":
|
| 17 |
"lora_bias": false,
|
| 18 |
-
"lora_dropout": 0
|
| 19 |
"megatron_config": null,
|
| 20 |
"megatron_core": "megatron.core",
|
| 21 |
"modules_to_save": null,
|
| 22 |
"peft_type": "LORA",
|
| 23 |
"qalora_group_size": 16,
|
| 24 |
-
"r":
|
| 25 |
"rank_pattern": {},
|
| 26 |
"revision": null,
|
| 27 |
"target_modules": [
|
| 28 |
"down_proj",
|
| 29 |
-
"k_proj",
|
| 30 |
-
"v_proj",
|
| 31 |
-
"o_proj",
|
| 32 |
-
"q_proj",
|
| 33 |
"up_proj",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
"gate_proj"
|
| 35 |
],
|
| 36 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 1 |
{
|
| 2 |
"alpha_pattern": {},
|
| 3 |
"auto_mapping": null,
|
| 4 |
+
"base_model_name_or_path": "unsloth/gemma-3-27b-it-unsloth-bnb-4bit",
|
| 5 |
"bias": "none",
|
| 6 |
"corda_config": null,
|
| 7 |
"eva_config": null,
|
|
|
|
| 13 |
"layers_pattern": null,
|
| 14 |
"layers_to_transform": null,
|
| 15 |
"loftq_config": {},
|
| 16 |
+
"lora_alpha": 32,
|
| 17 |
"lora_bias": false,
|
| 18 |
+
"lora_dropout": 0,
|
| 19 |
"megatron_config": null,
|
| 20 |
"megatron_core": "megatron.core",
|
| 21 |
"modules_to_save": null,
|
| 22 |
"peft_type": "LORA",
|
| 23 |
"qalora_group_size": 16,
|
| 24 |
+
"r": 32,
|
| 25 |
"rank_pattern": {},
|
| 26 |
"revision": null,
|
| 27 |
"target_modules": [
|
| 28 |
"down_proj",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"up_proj",
|
| 30 |
+
"q_proj",
|
| 31 |
+
"o_proj",
|
| 32 |
+
"v_proj",
|
| 33 |
+
"k_proj",
|
| 34 |
"gate_proj"
|
| 35 |
],
|
| 36 |
"task_type": "CAUSAL_LM",
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11a6572ca8f3f5696035a087b09db1a4f20baaa5103b1f3bb2b0ab4a0e2af2fe
|
| 3 |
+
size 932178320
|
added_tokens.json
CHANGED
|
@@ -1,28 +1,3 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"</tool_call>": 151658,
|
| 4 |
-
"</tool_response>": 151666,
|
| 5 |
-
"<think>": 151667,
|
| 6 |
-
"<tool_call>": 151657,
|
| 7 |
-
"<tool_response>": 151665,
|
| 8 |
-
"<|box_end|>": 151649,
|
| 9 |
-
"<|box_start|>": 151648,
|
| 10 |
-
"<|endoftext|>": 151643,
|
| 11 |
-
"<|file_sep|>": 151664,
|
| 12 |
-
"<|fim_middle|>": 151660,
|
| 13 |
-
"<|fim_pad|>": 151662,
|
| 14 |
-
"<|fim_prefix|>": 151659,
|
| 15 |
-
"<|fim_suffix|>": 151661,
|
| 16 |
-
"<|im_end|>": 151645,
|
| 17 |
-
"<|im_start|>": 151644,
|
| 18 |
-
"<|image_pad|>": 151655,
|
| 19 |
-
"<|object_ref_end|>": 151647,
|
| 20 |
-
"<|object_ref_start|>": 151646,
|
| 21 |
-
"<|quad_end|>": 151651,
|
| 22 |
-
"<|quad_start|>": 151650,
|
| 23 |
-
"<|repo_name|>": 151663,
|
| 24 |
-
"<|video_pad|>": 151656,
|
| 25 |
-
"<|vision_end|>": 151653,
|
| 26 |
-
"<|vision_pad|>": 151654,
|
| 27 |
-
"<|vision_start|>": 151652
|
| 28 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"<image_soft_token>": 262144
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
}
|
chat_template.jinja
CHANGED
|
@@ -1,5 +1,47 @@
|
|
| 1 |
-
{{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{ bos_token }}
|
| 2 |
+
{%- if messages[0]['role'] == 'system' -%}
|
| 3 |
+
{%- if messages[0]['content'] is string -%}
|
| 4 |
+
{%- set first_user_prefix = messages[0]['content'] + '
|
| 5 |
+
|
| 6 |
+
' -%}
|
| 7 |
+
{%- else -%}
|
| 8 |
+
{%- set first_user_prefix = messages[0]['content'][0]['text'] + '
|
| 9 |
+
|
| 10 |
+
' -%}
|
| 11 |
+
{%- endif -%}
|
| 12 |
+
{%- set loop_messages = messages[1:] -%}
|
| 13 |
+
{%- else -%}
|
| 14 |
+
{%- set first_user_prefix = "" -%}
|
| 15 |
+
{%- set loop_messages = messages -%}
|
| 16 |
+
{%- endif -%}
|
| 17 |
+
{%- for message in loop_messages -%}
|
| 18 |
+
{%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
|
| 19 |
+
{{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
|
| 20 |
+
{%- endif -%}
|
| 21 |
+
{%- if (message['role'] == 'assistant') -%}
|
| 22 |
+
{%- set role = "model" -%}
|
| 23 |
+
{%- else -%}
|
| 24 |
+
{%- set role = message['role'] -%}
|
| 25 |
+
{%- endif -%}
|
| 26 |
+
{{ '<start_of_turn>' + role + '
|
| 27 |
+
' + (first_user_prefix if loop.first else "") }}
|
| 28 |
+
{%- if message['content'] is string -%}
|
| 29 |
+
{{ message['content'] | trim }}
|
| 30 |
+
{%- elif message['content'] is iterable -%}
|
| 31 |
+
{%- for item in message['content'] -%}
|
| 32 |
+
{%- if item['type'] == 'image' -%}
|
| 33 |
+
{{ '<start_of_image>' }}
|
| 34 |
+
{%- elif item['type'] == 'text' -%}
|
| 35 |
+
{{ item['text'] | trim }}
|
| 36 |
+
{%- endif -%}
|
| 37 |
+
{%- endfor -%}
|
| 38 |
+
{%- else -%}
|
| 39 |
+
{{ raise_exception("Invalid content type") }}
|
| 40 |
+
{%- endif -%}
|
| 41 |
+
{{ '<end_of_turn>
|
| 42 |
+
' }}
|
| 43 |
+
{%- endfor -%}
|
| 44 |
+
{%- if add_generation_prompt -%}
|
| 45 |
+
{{'<start_of_turn>model
|
| 46 |
+
'}}
|
| 47 |
+
{%- endif -%}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": null,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_pan_and_scan": null,
|
| 5 |
+
"do_rescale": true,
|
| 6 |
+
"do_resize": true,
|
| 7 |
+
"image_mean": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.5,
|
| 10 |
+
0.5
|
| 11 |
+
],
|
| 12 |
+
"image_processor_type": "Gemma3ImageProcessor",
|
| 13 |
+
"image_seq_length": 256,
|
| 14 |
+
"image_std": [
|
| 15 |
+
0.5,
|
| 16 |
+
0.5,
|
| 17 |
+
0.5
|
| 18 |
+
],
|
| 19 |
+
"pan_and_scan_max_num_crops": null,
|
| 20 |
+
"pan_and_scan_min_crop_size": null,
|
| 21 |
+
"pan_and_scan_min_ratio_to_activate": null,
|
| 22 |
+
"processor_class": "Gemma3Processor",
|
| 23 |
+
"resample": 2,
|
| 24 |
+
"rescale_factor": 0.00392156862745098,
|
| 25 |
+
"size": {
|
| 26 |
+
"height": 896,
|
| 27 |
+
"width": 896
|
| 28 |
+
}
|
| 29 |
+
}
|
processor_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_seq_length": 256,
|
| 3 |
+
"processor_class": "Gemma3Processor"
|
| 4 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"<start_of_turn>",
|
| 4 |
-
"<end_of_turn>"
|
| 5 |
-
],
|
| 6 |
"bos_token": {
|
| 7 |
"content": "<bos>",
|
| 8 |
"lstrip": false,
|
|
@@ -10,13 +7,15 @@
|
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false
|
| 12 |
},
|
|
|
|
| 13 |
"eos_token": {
|
| 14 |
-
"content": "<
|
| 15 |
"lstrip": false,
|
| 16 |
"normalized": false,
|
| 17 |
"rstrip": false,
|
| 18 |
"single_word": false
|
| 19 |
},
|
|
|
|
| 20 |
"pad_token": {
|
| 21 |
"content": "<pad>",
|
| 22 |
"lstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"boi_token": "<start_of_image>",
|
|
|
|
|
|
|
|
|
|
| 3 |
"bos_token": {
|
| 4 |
"content": "<bos>",
|
| 5 |
"lstrip": false,
|
|
|
|
| 7 |
"rstrip": false,
|
| 8 |
"single_word": false
|
| 9 |
},
|
| 10 |
+
"eoi_token": "<end_of_image>",
|
| 11 |
"eos_token": {
|
| 12 |
+
"content": "<end_of_turn>",
|
| 13 |
"lstrip": false,
|
| 14 |
"normalized": false,
|
| 15 |
"rstrip": false,
|
| 16 |
"single_word": false
|
| 17 |
},
|
| 18 |
+
"image_token": "<image_soft_token>",
|
| 19 |
"pad_token": {
|
| 20 |
"content": "<pad>",
|
| 21 |
"lstrip": false,
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a872e3bb510a751b26bd65f61aad05f948c9cf78fe4f787aebd197b393cc4081
|
| 3 |
+
size 33384667
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
|
| 3 |
+
size 4689074
|
tokenizer_config.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37f032582a3365e34790b296b49ea6eeb3ab720d82783d279345a9fa1faf47e3
|
| 3 |
+
size 6097
|