Add detailed model card with training statistics
Browse files
README.md
CHANGED
|
@@ -1,199 +1,147 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
##
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
-
|
| 76 |
-
## Training Details
|
| 77 |
-
|
| 78 |
-
### Training Data
|
| 79 |
-
|
| 80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
-
|
| 84 |
-
### Training Procedure
|
| 85 |
-
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
-
|
| 88 |
-
#### Preprocessing [optional]
|
| 89 |
-
|
| 90 |
-
[More Information Needed]
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
#### Training Hyperparameters
|
| 94 |
-
|
| 95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 96 |
-
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
-
|
| 99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 100 |
-
|
| 101 |
-
[More Information Needed]
|
| 102 |
-
|
| 103 |
-
## Evaluation
|
| 104 |
-
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
-
|
| 171 |
-
## Citation [optional]
|
| 172 |
-
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
-
**BibTeX:**
|
| 176 |
-
|
| 177 |
-
[More Information Needed]
|
| 178 |
-
|
| 179 |
-
**APA:**
|
| 180 |
-
|
| 181 |
-
[More Information Needed]
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
-
|
| 193 |
-
## Model Card Authors [optional]
|
| 194 |
-
|
| 195 |
-
[More Information Needed]
|
| 196 |
-
|
| 197 |
-
## Model Card Contact
|
| 198 |
-
|
| 199 |
-
[More Information Needed]
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- ja
|
| 4 |
+
- en
|
| 5 |
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- fine-tuned
|
| 9 |
+
- japanese-gpt2-medium
|
| 10 |
+
- conversational
|
| 11 |
+
- japanese
|
| 12 |
+
- merged
|
| 13 |
+
license: mit
|
| 14 |
+
base_model: rinna/japanese-gpt2-medium
|
| 15 |
+
|
| 16 |
+
datasets:
|
| 17 |
+
- custom
|
| 18 |
+
metrics:
|
| 19 |
+
- perplexity
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# rc4rinna-gpt2-medium-finetuned
|
| 23 |
+
|
| 24 |
+
## モデル概要
|
| 25 |
+
|
| 26 |
+
このモデルは[rinna/japanese-gpt2-medium](rinna/japanese-gpt2-medium)をベースとしたファインチューニング済みモデルです。
|
| 27 |
+
|
| 28 |
+
- **ベースモデル**: rinna/japanese-gpt2-medium
|
| 29 |
+
- **モデルタイプ**: Fine-tuned Model
|
| 30 |
+
- **言語**: 日本語、英語
|
| 31 |
+
- **ライセンス**: MIT
|
| 32 |
+
- **訓練日時**: 2025-06-12 03:40:14
|
| 33 |
+
|
| 34 |
+
## 訓練詳細
|
| 35 |
+
|
| 36 |
+
### データセット
|
| 37 |
+
- **データセットファイル**: constitution_chat.jsonl
|
| 38 |
+
- **サンプル数**: 60 件
|
| 39 |
+
- **最大トークン長**: 1024
|
| 40 |
+
- **データ形式**: JSONL (対話形式)
|
| 41 |
+
|
| 42 |
+
### 訓練パラメータ
|
| 43 |
+
- **訓練可能パラメータ**: 12,582,912 個
|
| 44 |
+
- **総パラメータ**: 348,710,912 個
|
| 45 |
+
- **訓練可能割合**: 3.6084%
|
| 46 |
+
- **エポック数**: 3
|
| 47 |
+
- **バッチサイズ**: 4
|
| 48 |
+
- **学習率**: 5e-05
|
| 49 |
+
- **データセットサイズ**: 60 サンプル
|
| 50 |
+
- **訓練時間**: 0:00:08.025371
|
| 51 |
|
| 52 |
+
### LoRA設定(該当する場合)
|
| 53 |
+
- **LoRA Rank (r)**: 32
|
| 54 |
+
- **LoRA Alpha**: 64
|
| 55 |
+
- **LoRA Dropout**: 0.1
|
| 56 |
+
- **対象モジュール**: c_attn, c_proj, c_fc
|
| 57 |
|
| 58 |
+
## 使用方法
|
| 59 |
|
| 60 |
+
### 直接使用(マージ済みモデル)
|
| 61 |
|
| 62 |
+
```python
|
| 63 |
+
import torch
|
| 64 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 65 |
|
| 66 |
+
# モデルとトークナイザーを読み込み
|
| 67 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 68 |
+
"eyepyon/rc4rinna-gpt2-medium-finetuned",
|
| 69 |
+
torch_dtype=torch.float16,
|
| 70 |
+
device_map="auto"
|
| 71 |
+
)
|
| 72 |
+
tokenizer = AutoTokenizer.from_pretrained("eyepyon/rc4rinna-gpt2-medium-finetuned")
|
| 73 |
|
| 74 |
+
# 推論の実行
|
| 75 |
+
def generate_response(prompt):
|
| 76 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 77 |
+
with torch.no_grad():
|
| 78 |
+
outputs = model.generate(
|
| 79 |
+
**inputs,
|
| 80 |
+
max_new_tokens=512,
|
| 81 |
+
temperature=0.7,
|
| 82 |
+
do_sample=True,
|
| 83 |
+
pad_token_id=tokenizer.eos_token_id
|
| 84 |
+
)
|
| 85 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 86 |
+
return response[len(prompt):]
|
| 87 |
|
| 88 |
+
# 使用例
|
| 89 |
+
prompt = "Human: こんにちは!\n\nAssistant: "
|
| 90 |
+
response = generate_response(prompt)
|
| 91 |
+
print(response)
|
| 92 |
+
```
|
| 93 |
|
| 94 |
+
### Ollamaでの使用
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
+
```bash
|
| 97 |
+
# モデルをダウンロード
|
| 98 |
+
ollama pull eyepyon/rc4rinna-gpt2-medium-finetuned
|
| 99 |
|
| 100 |
+
# チャット開始
|
| 101 |
+
ollama run eyepyon/rc4rinna-gpt2-medium-finetuned
|
| 102 |
+
```
|
| 103 |
|
| 104 |
+
## パフォーマンス
|
|
|
|
|
|
|
| 105 |
|
| 106 |
+
このモデルは以下のタスクに特化して訓練されています:
|
| 107 |
+
- 質問応答
|
| 108 |
+
- 対話生成
|
| 109 |
+
- テキスト生成
|
| 110 |
|
| 111 |
+
## 制限事項
|
| 112 |
|
| 113 |
+
- このモデルは特定のドメインでファインチューニングされているため、汎用的な用途には適さない場合があります
|
| 114 |
+
- 生成されるテキストの正確性については、使用前に検証することを推奨します
|
| 115 |
+
- バイアスが含まれる可能性があります
|
| 116 |
|
| 117 |
+
## 倫理的考慮事項
|
| 118 |
|
| 119 |
+
- このモデルの出力は教育・研究目的での使用を想定しています
|
| 120 |
+
- 有害なコンテンツの生成を避けるため、適切なフィルタリングを実装することを推奨します
|
| 121 |
+
- 商用利用の際は、出力内容について十分な検証を行ってください
|
| 122 |
+
|
| 123 |
+
## 引用
|
| 124 |
+
|
| 125 |
+
```bibtex
|
| 126 |
+
@misc{rc4rinna_gpt2_medium_finetuned,
|
| 127 |
+
title={rc4rinna-gpt2-medium-finetuned},
|
| 128 |
+
author={Your Name},
|
| 129 |
+
year={2025},
|
| 130 |
+
publisher={Hugging Face},
|
| 131 |
+
url={https://huggingface.co/eyepyon/rc4rinna-gpt2-medium-finetuned}
|
| 132 |
+
}
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
## 謝辞
|
| 136 |
+
|
| 137 |
+
- ベースモデル: [rinna/japanese-gpt2-medium](https://huggingface.co/rinna/japanese-gpt2-medium)
|
| 138 |
+
- LoRA実装: [PEFT](https://github.com/huggingface/peft)
|
| 139 |
+
- 訓練フレームワーク: [Transformers](https://github.com/huggingface/transformers)
|
| 140 |
+
|
| 141 |
+
## 更新履歴
|
| 142 |
+
|
| 143 |
+
- **v1.0** (2025-06-12): 初回リリース
|
| 144 |
+
|
| 145 |
+
## お問い合わせ
|
| 146 |
+
|
| 147 |
+
モデルに関する質問や改善提案がございましたら、リポジトリのIssueまでお気軽にご連絡ください。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|