Training in progress, step 50
Browse files- README.md +15 -13
- adapter_config.json +49 -45
- adapter_model.safetensors +2 -2
- chat_template.jinja +54 -54
- tokenizer.json +2 -2
- tokenizer_config.json +16 -15
- training_args.bin +3 -0
README.md
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
---
|
| 2 |
base_model: unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit
|
| 3 |
library_name: transformers
|
| 4 |
-
model_name:
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- trl
|
| 8 |
- grpo
|
|
|
|
| 9 |
licence: license
|
| 10 |
---
|
| 11 |
|
| 12 |
-
# Model Card for
|
| 13 |
|
| 14 |
This model is a fine-tuned version of [unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit).
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
@@ -20,7 +21,7 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 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="
|
| 24 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 25 |
print(output["generated_text"])
|
| 26 |
```
|
|
@@ -30,15 +31,14 @@ print(output["generated_text"])
|
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
-
|
| 34 |
This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
|
| 35 |
|
| 36 |
### Framework versions
|
| 37 |
|
| 38 |
-
- TRL:
|
| 39 |
- Transformers: 5.5.0
|
| 40 |
-
- Pytorch: 2.
|
| 41 |
-
- Datasets: 4.
|
| 42 |
- Tokenizers: 0.22.2
|
| 43 |
|
| 44 |
## Citations
|
|
@@ -52,16 +52,18 @@ Cite GRPO as:
|
|
| 52 |
year = 2024,
|
| 53 |
eprint = {arXiv:2402.03300},
|
| 54 |
}
|
|
|
|
| 55 |
```
|
| 56 |
|
| 57 |
Cite TRL as:
|
| 58 |
|
| 59 |
```bibtex
|
| 60 |
-
@
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 66 |
}
|
| 67 |
```
|
|
|
|
| 1 |
---
|
| 2 |
base_model: unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit
|
| 3 |
library_name: transformers
|
| 4 |
+
model_name: Manthan-1.5B
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
| 7 |
- trl
|
| 8 |
- grpo
|
| 9 |
+
- unsloth
|
| 10 |
licence: license
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Model Card for Manthan-1.5B
|
| 14 |
|
| 15 |
This model is a fine-tuned version of [unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit).
|
| 16 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
|
|
| 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="Shahansha/Manthan-1.5B", device="cuda")
|
| 25 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 26 |
print(output["generated_text"])
|
| 27 |
```
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
|
|
|
|
| 34 |
This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
|
| 35 |
|
| 36 |
### Framework versions
|
| 37 |
|
| 38 |
+
- TRL: 0.24.0
|
| 39 |
- Transformers: 5.5.0
|
| 40 |
+
- Pytorch: 2.10.0+cu128
|
| 41 |
+
- Datasets: 4.3.0
|
| 42 |
- Tokenizers: 0.22.2
|
| 43 |
|
| 44 |
## Citations
|
|
|
|
| 52 |
year = 2024,
|
| 53 |
eprint = {arXiv:2402.03300},
|
| 54 |
}
|
| 55 |
+
|
| 56 |
```
|
| 57 |
|
| 58 |
Cite TRL as:
|
| 59 |
|
| 60 |
```bibtex
|
| 61 |
+
@misc{vonwerra2022trl,
|
| 62 |
+
title = {{TRL: Transformer Reinforcement Learning}},
|
| 63 |
+
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},
|
| 64 |
+
year = 2020,
|
| 65 |
+
journal = {GitHub repository},
|
| 66 |
+
publisher = {GitHub},
|
| 67 |
+
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 68 |
}
|
| 69 |
```
|
adapter_config.json
CHANGED
|
@@ -1,46 +1,50 @@
|
|
| 1 |
-
{
|
| 2 |
-
"alora_invocation_tokens": null,
|
| 3 |
-
"alpha_pattern": {},
|
| 4 |
-
"arrow_config": null,
|
| 5 |
-
"auto_mapping":
|
| 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 |
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": {
|
| 6 |
+
"base_model_class": "Qwen2ForCausalLM",
|
| 7 |
+
"parent_library": "transformers.models.qwen2.modeling_qwen2",
|
| 8 |
+
"unsloth_fixed": true
|
| 9 |
+
},
|
| 10 |
+
"base_model_name_or_path": "unsloth/Qwen2.5-1.5B-Instruct-bnb-4bit",
|
| 11 |
+
"bias": "none",
|
| 12 |
+
"corda_config": null,
|
| 13 |
+
"ensure_weight_tying": false,
|
| 14 |
+
"eva_config": null,
|
| 15 |
+
"exclude_modules": null,
|
| 16 |
+
"fan_in_fan_out": false,
|
| 17 |
+
"inference_mode": true,
|
| 18 |
+
"init_lora_weights": true,
|
| 19 |
+
"layer_replication": null,
|
| 20 |
+
"layers_pattern": null,
|
| 21 |
+
"layers_to_transform": null,
|
| 22 |
+
"loftq_config": {},
|
| 23 |
+
"lora_alpha": 16,
|
| 24 |
+
"lora_bias": false,
|
| 25 |
+
"lora_dropout": 0.0,
|
| 26 |
+
"megatron_config": null,
|
| 27 |
+
"megatron_core": "megatron.core",
|
| 28 |
+
"modules_to_save": null,
|
| 29 |
+
"peft_type": "LORA",
|
| 30 |
+
"peft_version": "0.18.1",
|
| 31 |
+
"qalora_group_size": 16,
|
| 32 |
+
"r": 16,
|
| 33 |
+
"rank_pattern": {},
|
| 34 |
+
"revision": null,
|
| 35 |
+
"target_modules": [
|
| 36 |
+
"v_proj",
|
| 37 |
+
"k_proj",
|
| 38 |
+
"down_proj",
|
| 39 |
+
"gate_proj",
|
| 40 |
+
"q_proj",
|
| 41 |
+
"o_proj",
|
| 42 |
+
"up_proj"
|
| 43 |
+
],
|
| 44 |
+
"target_parameters": null,
|
| 45 |
+
"task_type": "CAUSAL_LM",
|
| 46 |
+
"trainable_token_indices": null,
|
| 47 |
+
"use_dora": false,
|
| 48 |
+
"use_qalora": false,
|
| 49 |
+
"use_rslora": false
|
| 50 |
}
|
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:ea25ef61d0976859e6a46bc9bf795f78e1d0392cf8133cdc39f1e6ad79e2dba4
|
| 3 |
+
size 73911112
|
chat_template.jinja
CHANGED
|
@@ -1,54 +1,54 @@
|
|
| 1 |
-
{%- if tools %}
|
| 2 |
-
{{- '<|im_start|>system\n' }}
|
| 3 |
-
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
-
{{- messages[0]['content'] }}
|
| 5 |
-
{%- else %}
|
| 6 |
-
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
-
{%- endif %}
|
| 8 |
-
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 9 |
-
{%- for tool in tools %}
|
| 10 |
-
{{- "\n" }}
|
| 11 |
-
{{- tool | tojson }}
|
| 12 |
-
{%- endfor %}
|
| 13 |
-
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
-
{%- else %}
|
| 15 |
-
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
-
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
-
{%- else %}
|
| 18 |
-
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
-
{%- endif %}
|
| 20 |
-
{%- endif %}
|
| 21 |
-
{%- for message in messages %}
|
| 22 |
-
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
-
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
-
{%- elif message.role == "assistant" %}
|
| 25 |
-
{{- '<|im_start|>' + message.role }}
|
| 26 |
-
{%- if message.content %}
|
| 27 |
-
{{- '\n' + message.content }}
|
| 28 |
-
{%- endif %}
|
| 29 |
-
{%- for tool_call in message.tool_calls %}
|
| 30 |
-
{%- if tool_call.function is defined %}
|
| 31 |
-
{%- set tool_call = tool_call.function %}
|
| 32 |
-
{%- endif %}
|
| 33 |
-
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
-
{{- tool_call.name }}
|
| 35 |
-
{{- '", "arguments": ' }}
|
| 36 |
-
{{- tool_call.arguments | tojson }}
|
| 37 |
-
{{- '}\n</tool_call>' }}
|
| 38 |
-
{%- endfor %}
|
| 39 |
-
{{- '<|im_end|>\n' }}
|
| 40 |
-
{%- elif message.role == "tool" %}
|
| 41 |
-
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
-
{{- '<|im_start|>user' }}
|
| 43 |
-
{%- endif %}
|
| 44 |
-
{{- '\n<tool_response>\n' }}
|
| 45 |
-
{{- message.content }}
|
| 46 |
-
{{- '\n</tool_response>' }}
|
| 47 |
-
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
-
{{- '<|im_end|>\n' }}
|
| 49 |
-
{%- endif %}
|
| 50 |
-
{%- endif %}
|
| 51 |
-
{%- endfor %}
|
| 52 |
-
{%- if add_generation_prompt %}
|
| 53 |
-
{{- '<|im_start|>assistant\n' }}
|
| 54 |
-
{%- endif %}
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
+
{{- messages[0]['content'] }}
|
| 5 |
+
{%- else %}
|
| 6 |
+
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
+
{%- endif %}
|
| 8 |
+
{{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 9 |
+
{%- for tool in tools %}
|
| 10 |
+
{{- "\n" }}
|
| 11 |
+
{{- tool | tojson }}
|
| 12 |
+
{%- endfor %}
|
| 13 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
+
{%- else %}
|
| 15 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 16 |
+
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- endif %}
|
| 21 |
+
{%- for message in messages %}
|
| 22 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
+
{%- elif message.role == "assistant" %}
|
| 25 |
+
{{- '<|im_start|>' + message.role }}
|
| 26 |
+
{%- if message.content %}
|
| 27 |
+
{{- '\n' + message.content }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- for tool_call in message.tool_calls %}
|
| 30 |
+
{%- if tool_call.function is defined %}
|
| 31 |
+
{%- set tool_call = tool_call.function %}
|
| 32 |
+
{%- endif %}
|
| 33 |
+
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
+
{{- tool_call.name }}
|
| 35 |
+
{{- '", "arguments": ' }}
|
| 36 |
+
{{- tool_call.arguments | tojson }}
|
| 37 |
+
{{- '}\n</tool_call>' }}
|
| 38 |
+
{%- endfor %}
|
| 39 |
+
{{- '<|im_end|>\n' }}
|
| 40 |
+
{%- elif message.role == "tool" %}
|
| 41 |
+
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
+
{{- '<|im_start|>user' }}
|
| 43 |
+
{%- endif %}
|
| 44 |
+
{{- '\n<tool_response>\n' }}
|
| 45 |
+
{{- message.content }}
|
| 46 |
+
{{- '\n</tool_response>' }}
|
| 47 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
+
{{- '<|im_end|>\n' }}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{%- if add_generation_prompt %}
|
| 53 |
+
{{- '<|im_start|>assistant\n' }}
|
| 54 |
+
{%- endif %}
|
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:e7428f444901bb069debdd4c4aff83f0394555b20b9c670e81026951f6b81c33
|
| 3 |
+
size 11422060
|
tokenizer_config.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
-
{
|
| 2 |
-
"add_prefix_space": false,
|
| 3 |
-
"backend": "tokenizers",
|
| 4 |
-
"bos_token": null,
|
| 5 |
-
"clean_up_tokenization_spaces": false,
|
| 6 |
-
"eos_token": "<|im_end|>",
|
| 7 |
-
"errors": "replace",
|
| 8 |
-
"is_local":
|
| 9 |
-
"model_max_length": 32768,
|
| 10 |
-
"pad_token": "<|vision_pad|>",
|
| 11 |
-
"padding_side": "left",
|
| 12 |
-
"split_special_tokens": false,
|
| 13 |
-
"tokenizer_class": "Qwen2Tokenizer",
|
| 14 |
-
"
|
| 15 |
-
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 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": "left",
|
| 12 |
+
"split_special_tokens": false,
|
| 13 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 14 |
+
"truncation_side": "left",
|
| 15 |
+
"unk_token": null
|
| 16 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abbf42c330406a916ff5046127fb1d84fcc066dcaea8401b2b2782cd6941c04a
|
| 3 |
+
size 6737
|