初始化项目,由ModelHub XC社区提供模型
Model: Rakuten/RakutenAI-2.0-mini-instruct Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
88
README.md
Normal file
88
README.md
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
- ja
|
||||||
|
base_model:
|
||||||
|
- Rakuten/RakutenAI-2.0-mini
|
||||||
|
---
|
||||||
|
|
||||||
|
# RakutenAI-2.0-mini-instruct
|
||||||
|
## Model Description
|
||||||
|
RakutenAI-2.0-mini-instruct is a lightweight yet powerful fine-tuned variant of [RakutenAI-2.0-mini](https://huggingface.co/Rakuten/RakutenAI-2.0-mini), specifically designed for edge devices and resource-constrained environments. While compact in size, this model delivers efficient, high-quality instruction-following capabilities, making it an ideal choice for on-device AI applications, low-latency inference, and cost-effective deployment. It achieves competitive performance within the sub-2B parameter category on Japanese MT Bench, offering a balance of speed, efficiency, and accuracy for real-world use cases.
|
||||||
|
|
||||||
|
*If you are looking for foundation model, check [RakutenAI-2.0-mini](https://huggingface.co/Rakuten/RakutenAI-2.0-mini)*.
|
||||||
|
|
||||||
|
## Model Evaluation Results
|
||||||
|
|
||||||
|
|Instruct Model Name | Size | Japanese MT-Bench Score |
|
||||||
|
|:-------------------------------------------------------------|:-----------:|:-------------------------:|
|
||||||
|
| Rakuten/RakutenAI-2.0-mini-instruct | 1.5B | 4.91 |
|
||||||
|
| llm-jp/llm-jp-3-1.8b-instruct | 1.8B | 4.70 |
|
||||||
|
| llm-jp/llm-jp-3-3.7b-instruct | 3.7B | 4.98 |
|
||||||
|
| SakanaAI/EvoLLM-JP-A-v1-7B | 7B | 3.80 |
|
||||||
|
| SakanaAI/EvoLLM-JP-v1-7B | 7B | 4.58 |
|
||||||
|
|
||||||
|
|
||||||
|
<div style="text-align: center;">Table1: RakutenAI-2.0-mini-instruct performance on MT Bench in comparison with other Japanese open models.</div>
|
||||||
|
|
||||||
|
|
||||||
|
**Note on Evaluation Scores:**
|
||||||
|
- Japanese MT-bench is a set of 80 challenging open-ended questions for evaluating chat assistants on eight dimensions: writing, roleplay, reasoning, math, coding, extraction, stem, humanities. https://github.com/Stability-AI/FastChat/tree/jp-stable/fastchat/llm_judge Evaluation of responses is conducted with GPT4(gpt-4o-2024-05-13) as a judge, in line with public leaderboard.
|
||||||
|
- The Japanese research community cautions against not to evaluate fine-tuned models on LM Harness due to task contamination, so we have not included the LM-Harness scores in this model card for instruct models. ```LLM-jp: jasterを用いてインストラクションチューニングを施したモデルが、テストデータをインストラクションチューニングに使用していない場合でも, llm-jp-evalの評価スコアを非常に高くすることができることが明らかになっている. したがって、高い評価スコアを得たからといって、他のLLMよりも性能が優れていると断言するのは適切ではないことに注意されたい。 Machine Translation: It has become clear that models that have been instruction tuned using Jaster can achieve very high evaluation scores on LLM-JP-EVAL, even if test data is not used for instruction tuning. Therefore, please note that it is not appropriate to assert that a model's performance is superior to other LLMs just because it has a high evaluation score.``` More details can be found at [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval/blob/dev/README.md).
|
||||||
|
- Final score `(4.91 +/- 0.023)` for RakutenAI-2.0-mini-instruct is average of 3 runs on Japanese MT-Bench. Model outputs and judge outputs are uploaded for reference.
|
||||||
|
|
||||||
|
|
||||||
|
## Model Usage
|
||||||
|
```python
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
|
||||||
|
model_path = "Rakuten/RakutenAI-2.0-mini-instruct"
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype="auto", device_map="auto")
|
||||||
|
model.eval()
|
||||||
|
|
||||||
|
chat = [
|
||||||
|
{"role": "system", "content": "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."},
|
||||||
|
{"role": "user", "content": "How to make an authentic Spanish Omelette?"},
|
||||||
|
]
|
||||||
|
|
||||||
|
input_ids = tokenizer.apply_chat_template(chat, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(device=model.device)
|
||||||
|
attention_mask = input_ids.ne(tokenizer.pad_token_id).long()
|
||||||
|
tokens = model.generate(
|
||||||
|
input_ids,
|
||||||
|
max_length=2048,
|
||||||
|
do_sample=False,
|
||||||
|
num_beams=1,
|
||||||
|
pad_token_id=tokenizer.eos_token_id,
|
||||||
|
attention_mask=attention_mask,
|
||||||
|
)
|
||||||
|
out = tokenizer.decode(tokens[0][len(input_ids[0]):], skip_special_tokens=True)
|
||||||
|
print("ASSISTANT:\n" + out)
|
||||||
|
print()
|
||||||
|
```
|
||||||
|
## Model Details
|
||||||
|
|
||||||
|
* **Developed by**: [Rakuten Group, Inc.](https://ai.rakuten.com/)
|
||||||
|
* **Language(s)**: Japanese, English
|
||||||
|
* **License**: This model is licensed under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
||||||
|
* **Model Architecture**: Transformer
|
||||||
|
|
||||||
|
### Limitations and Bias
|
||||||
|
|
||||||
|
The suite of RakutenAI-2.0 models is capable of generating human-like text on a wide range of topics. However, like all LLMs, they have limitations and can produce biased, inaccurate, or unsafe outputs. Please exercise caution and judgement while interacting with them.
|
||||||
|
|
||||||
|
## Citation
|
||||||
|
For citing our work on the suite of RakutenAI-2.0 models, please use:
|
||||||
|
|
||||||
|
```
|
||||||
|
@misc{rakutengroup2025rakutenai2.0,
|
||||||
|
author = {Rakuten Group, Inc.},
|
||||||
|
title = {RakutenAI-2.0},
|
||||||
|
year = {2025},
|
||||||
|
publisher = {Hugging Face},
|
||||||
|
url = {https://huggingface.co/Rakuten},
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
29
config.json
Normal file
29
config.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"_flash_attn_2_enabled": true,
|
||||||
|
"_name_or_path": "Rakuten/RakutenAI-2.0-mini-instruct",
|
||||||
|
"architectures": [
|
||||||
|
"MistralForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"head_dim": 64,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 2048,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 8192,
|
||||||
|
"max_position_embeddings": 131072,
|
||||||
|
"model_type": "mistral",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_hidden_layers": 22,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_theta": 100000.0,
|
||||||
|
"sliding_window": 8192,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"torch_dtype": "bfloat16",
|
||||||
|
"transformers_version": "4.39.3",
|
||||||
|
"use_cache": true,
|
||||||
|
"use_transformers_inputs": true,
|
||||||
|
"vocab_size": 48000
|
||||||
|
}
|
||||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"transformers_version": "4.39.3"
|
||||||
|
}
|
||||||
80
judge_outputs/model_judgement_run1__1turn.jsonl
Normal file
80
judge_outputs/model_judgement_run1__1turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
80
judge_outputs/model_judgement_run1__2turn.jsonl
Normal file
80
judge_outputs/model_judgement_run1__2turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
80
judge_outputs/model_judgement_run2__1turn.jsonl
Normal file
80
judge_outputs/model_judgement_run2__1turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
80
judge_outputs/model_judgement_run2__2turn.jsonl
Normal file
80
judge_outputs/model_judgement_run2__2turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
80
judge_outputs/model_judgement_run3__1turn.jsonl
Normal file
80
judge_outputs/model_judgement_run3__1turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
80
judge_outputs/model_judgement_run3__2turn.jsonl
Normal file
80
judge_outputs/model_judgement_run3__2turn.jsonl
Normal file
File diff suppressed because one or more lines are too long
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:724214f9446b39dac612c39054ed33323ecb6c021ce6a639fcf14de9aa414573
|
||||||
|
size 3069389424
|
||||||
35
special_tokens_map.json
Normal file
35
special_tokens_map.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"additional_special_tokens": [
|
||||||
|
"<unk>",
|
||||||
|
"<s>",
|
||||||
|
"</s>"
|
||||||
|
],
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
370213
tokenizer.json
Normal file
370213
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
3
tokenizer.model
Normal file
3
tokenizer.model
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:7978987401ef447724ded0544d048831954b7517a96555ce1593149e3678b6dc
|
||||||
|
size 755169
|
||||||
48
tokenizer_config.json
Normal file
48
tokenizer_config.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"add_bos_token": true,
|
||||||
|
"add_eos_token": false,
|
||||||
|
"add_prefix_space": null,
|
||||||
|
"added_tokens_decoder": {
|
||||||
|
"0": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"1": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additional_special_tokens": [
|
||||||
|
"<unk>",
|
||||||
|
"<s>",
|
||||||
|
"</s>"
|
||||||
|
],
|
||||||
|
"bos_token": "<s>",
|
||||||
|
"chat_template": "\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] | trim + ' ' %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = 'A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user\\'s questions. ' %}\n{%- endif %}\n\n{{- system_message }}\n{%- for message in messages %}\n {%- if message['role'] == 'user' %}\n {{- 'USER: ' + message['content'] | trim }}\n {%- elif message['role'] == 'assistant' %}\n {{- ' ASSISTANT: ' + message['content'] | trim + '</s>' }}\n {%- endif %}\n{%- endfor %}\n\n{%- if add_generation_prompt %}\n {{- ' ASSISTANT:' }}\n{%- endif %}\n",
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": "</s>",
|
||||||
|
"legacy": true,
|
||||||
|
"model_max_length": 1000000000000000019884624838656,
|
||||||
|
"pad_token": "</s>",
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"spaces_between_special_tokens": false,
|
||||||
|
"tokenizer_class": "LlamaTokenizer",
|
||||||
|
"unk_token": "<unk>",
|
||||||
|
"use_default_system_prompt": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user