--- license: apache-2.0 language: - ja pipeline_tag: text-generation library_name: transformers tags: - not-for-all-audiences --- # Doujinshi-14b-instruct Doujinshi-14b-instructは、r18に特化した大規模言語モデル(LLM)であり、[Qwen/Qwen3-14B](https://huggingface.co/Qwen/Qwen3-14B) をベースに継続事前学習,dpo,sftを行いました。本モデルは、dmm.co.jp,dlsite.comよりスクレイピングし作成した40億トークンのr18向けデータセットを使用してトレーニングされています。 このモデルは、指示形式でファインチューニングしたモデルです。 モデルの出力に関して責任を負いません。各自自己責任で利用してください。 ## モデルの種類と特徴 | Model Variants | 特徴 | | :----------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | | [Doujinshi-14b-chat](https://huggingface.co/puwaer/Doujinshi-14b-chat) | **会話特化**のバージョン。自然な日常会話やフリートークに強く、ユーザーとのやりとりをスムーズに進められます。 | | [Doujinshi-14b-instruct](https://huggingface.co/puwaer/Doujinshi-14b-instruct) | **情報提供特化**のバージョン。質問応答や説明タスクに強く、ユーザーの指示に沿った文章生成を重視。 | | [Doujinshi-14b-roleplay](https://huggingface.co/puwaer/Doujinshi-14b-roleplay) | **キャラになりきるロールプレイ特化**のバージョン。ユーザーとの対話で一人称やキャラ口調を維持しやすく、恋愛・ストーリー・没入感のある会話に適している。 | ## 使用方法 ### モデルのロードと推論 以下のコードでモデルをロードし、テキスト生成を行うことができます。 ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "puwaer/Doujinshi-14b-instruct" model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained(model_name) prompt = "avの良さを教えて" messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt} ] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) model_inputs = tokenizer([text], return_tensors="pt").to(model.device) generated_ids = model.generate( **model_inputs, max_new_tokens=1024 ) generated_ids = [ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) ] response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] ``` ## 使用データセット 本モデルは、以下のデータセットを使用して継続事前学習,dpo,sftを行いました。 - [puwaer/dlsite-jp-v1](https://huggingface.co/datasets/puwaer/dlsite-jp-v1) - [puwaer/dlsite-jp-v2](https://huggingface.co/datasets/puwaer/dlsite-jp-v2) - [puwaer/dlsite-jp-v3](https://huggingface.co/datasets/puwaer/dlsite-jp-v3) - [puwaer/dmm-fanza-jp-v1](https://huggingface.co/datasets/puwaer/dmm-fanza-jp-v1) - [puwaer/dmm-fanza-jp-v2](https://huggingface.co/datasets/puwaer/dmm-fanza-jp-v2) - [puwaer/dmm-fanza-jp-v3](https://huggingface.co/datasets/puwaer/dmm-fanza-jp-v3) - [puwaer/Doujinshi-sft-dataset-v1](https://huggingface.co/datasets/puwaer/Doujinshi-sft-dataset-v1) - [puwaer/Doujinshi-dpo-dataset-v1](https://huggingface.co/datasets/puwaer/Doujinshi-dpo-dataset-v1) ## ライセンス 本モデルは [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) のもとで提供されます。