初始化项目,由ModelHub XC社区提供模型

Model: puwaer/Doujinshi-1.8b
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-23 15:26:10 +08:00
commit 5e7d6ab7a9
8 changed files with 398800 additions and 0 deletions

35
.gitattributes vendored Normal file
View 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

77
README.md Normal file
View File

@@ -0,0 +1,77 @@
---
license: apache-2.0
language:
- ja
pipeline_tag: text-generation
library_name: transformers
tags:
- not-for-all-audiences
---
# Doujinshi-1.8b
Doujinshi-1.8bは、r18に特化した大規模言語モデルLLMであり、[llm-jp/llm-jp-3-1.8b](https://huggingface.co/llm-jp/llm-jp-3-1.8b) をベースに継続事前学習を行いました。本モデルは、同人コンテンツに関連する知識を強化するため、dmm.co.jp,dlsite.comよりスクレイピングし作成したr18向けデータセットを使用してトレーニングされています。
モデルの出力に関して責任を負いません。各自自己責任で利用してください。
| Model Variants |
| :--- |
| [Doujinshi-1.8b](https://huggingface.co/puwaer/Doujinshi-1.8b) |
| [Doujinshi-1.8b-instruct](https://huggingface.co/puwaer/Doujinshi-1.8b-instruct) |
## モデル概要
本モデルは、以下のデータセットを使用して追加学習を行いました。
- [puwaer/dlsite-jp-v1](https://huggingface.co/datasets/puwaer/dlsite-jp-v1)
- [puwaer/dmm-fanza-jp-v1](https://huggingface.co/datasets/puwaer/dmm-fanza-jp-v1)
## 特徴
- **ベースモデル**: [llm-jp/llm-jp-3-1.8b](https://huggingface.co/llm-jp/llm-jp-3-1.8b)
- **日本語のテキスト生成に特化**
- **r18に関する知識を強化**
## 使用方法
### モデルのロードと推論
以下のコードでモデルをロードし、テキスト生成を行うことができます。
```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("puwaer/Doujinshi-1.8b")
model = AutoModelForCausalLM.from_pretrained("puwaer/Doujinshi-1.8b", device_map="auto", torch_dtype=torch.bfloat16)
text = "avの良さを教えて"
tokenized_input = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(
tokenized_input,
max_new_tokens=100,
do_sample=True,
top_p=0.95,
temperature=0.7,
repetition_penalty=1.05,
)[0]
print(tokenizer.decode(output))
```
## ライセンス
本モデルは [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) のもとで提供されます。
## クレジット
- **ベースモデル**: [llm-jp/llm-jp-3-1.8b](https://huggingface.co/llm-jp/llm-jp-3-1.8b)
- **データセット提供**:
- [puwaer/dlsite-jp-v1](https://huggingface.co/datasets/puwaer/dlsite-jp-v1)
- [puwaer/dmm-fanza-jp-v1](https://huggingface.co/datasets/puwaer/dmm-fanza-jp-v1)
- **作成方法詳細**: [特化型llm(Doujinshi-1.8b)の開発報告書①:開発の全体像](https://zenn.dev/articles/doujinshi_development_report_1)
- **使用コード**: [github/puwaer](https://github.com/puwaer)
## 開発支援のお願い
現在、開発を続けていますが、クラウドGPUの価格が高く、十分な計算リソースを確保できずにいます。そのため、思い通りに開発が出来ていません。
また、オープンソースの理念を大切にしており、プログラム・データセット・モデルを有料で公開するつもりはありません。そのため、金銭的に余裕のある方に支援していただけると大変助かります。
TwitterのDMやご支援いただける方は、以下のプラットフォームよりお願いいたします。
- [Twitter](https://x.com/puwaer)
- [Zenn](https://zenn.dev/puwa/books/doujinshi_development_book)
- [github sponsors](https://github.com/sponsors/puwaer)

28
config.json Normal file
View File

@@ -0,0 +1,28 @@
{
"_name_or_path": "None",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"hidden_size": 2048,
"initializer_range": 0.02,
"intermediate_size": 7168,
"max_position_embeddings": 4096,
"model_type": "llama",
"num_attention_heads": 16,
"num_hidden_layers": 24,
"num_key_value_heads": 16,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 10000,
"tie_word_embeddings": false,
"torch_dtype": "float16",
"transformers_version": "4.36.0",
"use_cache": false,
"vocab_size": 99584
}

6
generation_config.json Normal file
View File

@@ -0,0 +1,6 @@
{
"_from_model_config": true,
"bos_token_id": 1,
"eos_token_id": 2,
"transformers_version": "4.36.0"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:250f65b8610ad7671b19503616116bc5e9f8b68fb22567c694f2376030083d6c
size 3735253552

51
special_tokens_map.json Normal file
View File

@@ -0,0 +1,51 @@
{
"bos_token": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"cls_token": {
"content": "<CLS|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"mask_token": {
"content": "<MASK|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"sep_token": {
"content": "<SEP|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

398502
tokenizer.json Normal file

File diff suppressed because it is too large Load Diff

98
tokenizer_config.json Normal file
View File

@@ -0,0 +1,98 @@
{
"add_bos_token": true,
"add_eos_token": false,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "</s>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"3": {
"content": "<MASK|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"4": {
"content": "<PAD|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"5": {
"content": "<CLS|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"6": {
"content": "<SEP|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"7": {
"content": "<EOD|LLM-jp>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"99574": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"bos_token": "<s>",
"clean_up_tokenization_spaces": false,
"cls_token": "<CLS|LLM-jp>",
"eod_token": "</s>",
"eos_token": "</s>",
"extra_ids": 0,
"mask_token": "<MASK|LLM-jp>",
"max_length": 1024,
"model_max_length": 1000000000000000019884624838656,
"pad_to_multiple_of": null,
"pad_token": "<|endoftext|>",
"pad_token_type_id": 0,
"padding_side": "right",
"sep_token": "<SEP|LLM-jp>",
"sp_model_kwargs": {},
"stride": 0,
"tokenizer_class": "PreTrainedTokenizerFast",
"truncation_side": "right",
"truncation_strategy": "longest_first",
"unk_token": "<unk>"
}