--- language: - en license: apache-2.0 tags: - text-generation-inference - transformers - Japanese - unsloth - llama - trl base_model: unsloth/llama-3-8b-Instruct-bnb-4bit --- **This model is trained for the solely purpose of extracting title, name, keywords, short descriptions from any Japanese articles and returning them in a unified JSON format.** **このモデルは、日本語の記事を抽出し、統一されたJSON形式で返すために訓練されています。** # Uploaded model - **Developed by:** Evolany AI - **License:** apache-2.0 - **Finetuned from model :** unsloth/llama-3-8b-Instruct-bnb-4bit We trained on 1 x A100 GPU. User prompt: Any news article in Japanese (max length up to 4096 tokens). Eg: ```text 株式会社ジャレコ(本社:東京都新宿区市谷八幡町)は、NTTドコモ FOMA903iシリーズの大容量iアプリゲーム“メガゲーム”対応第一弾として、 2007年4月27日よりiモード公式サイト“ジャレコiギャレッソ”にて美少女対戦麻雀「アイドル雀士スーチーパイⅡ」の配信を開始いたします。 本作は、「スーチーパイ」シリーズの2作目としてアーケードで発売され、1996年にプレイステーションおよびセガサターン用ソフトとしてCD-ROMの特性を生かした豪華な出演声優陣による歌やお喋りなどがご好評をいただいた2人打ち麻雀ゲームの移植作です。携帯電話用ソフトでありながら、かないみか・松本梨香など声優陣のおしゃべりとムービーシーンがふんだんに使われ、「必殺技」や「パネルマッチ」、そして勝利した際の「ごほうびシーン」も再現し、家庭用ゲーム機版に匹敵する作品となっております。 かつてアーケード版や家庭用版で楽しまれた方はもちろん、なかなか勝てずに悔しい思いをした方、また今までプレイをしたことがない方にもオススメです。携帯電話でより身近になった「アイドル雀士スーチーパイⅡ」をぜひお楽しみください。 【アイドル雀士 スーチーパイⅡ(メガゲーム)概要】 タイトル : 「アイドル雀士スーチーパイⅡ」 (あいどるじゃんし すーちーぱいつー) ジャンル : 美少女対戦麻雀 配信日 : 2007年4月27日 対応機種 : NTTドコモ FOMA 903iシリーズ 料金 : 315円(税込、月額) 【スーチーパイとは】 1993年に家庭用ゲーム機の対戦麻雀ゲームとして発売された「スーチーパイ」は、イラストレーターの園田健一氏の描く魅力的なキャラクターや「必殺技」などの独自のゲーム性から人気を博し、いままでにシリーズ作および関連作が家庭用ゲーム機、アーケード版、PC版など様々な機種で発売されております。 現在、シリーズとして「Ⅲ」までがラインナップされており、2007年7月28日にPSPおよびニンテンドーDS用ソフトとして「アイドル雀士スーチーパイⅢ Remix」の発売を予定しております。 そして本年、タイトル名の由来となる数字の中国語読み”4”(スー)と”7”(チー)から、4月7日が「スーチーパイの日」として日本記念日協会に認定されております。 今後も「スーチーパイ」はさまざまな展開をお見せできる予定ですのでご期待ください! ``` Model response: ```json {"category": "製品・サービス", "company_name": "株式会社ジャレコ", "product_name": "アイドル雀士スーチーパイⅡ", "product_description": "美少女対戦麻雀ゲーム「アイドル雀士スーチーパイⅡ」が、NTTドコモ FOMA903iシリーズの大容量iアプリゲーム“メガゲーム”対応第一弾として、2007年4月27日よりiモード公式サイト“ジャレコiギャレッソ”にて配信を開始いたします。", "keywords": ["美少女", "対戦麻雀", "スーチーパイ", "アイドル雀士", "メガゲーム", "ジャレコ", "iモード", "iアプリ", "ドコモ", "FOMA"]}<|end_of_text|> ``` **QLoRA (4bit)** Params to replicate training Peft Config ``` r=8, target_modules=[ "q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj", ], lora_alpha=16, lora_dropout=0, bias="none", random_state=3407, use_rslora=False, # Rank stabilized LoRA loftq_config=None, # LoftQ ``` Training args ``` per_device_train_batch_size=2, per_device_eval_batch_size=2, gradient_accumulation_steps=4, # set to 4 to avoid issues with GPTQ Quantization warmup_steps=5, max_steps=300, # Fine-tune iterations learning_rate=2e-4, fp16=not torch.cuda.is_bf16_supported(), bf16=torch.cuda.is_bf16_supported(), evaluation_strategy="steps", prediction_loss_only=True, eval_accumulation_steps=1, eval_steps=10, logging_steps=1, optim="adamw_8bit", weight_decay=0.01, lr_scheduler_type="cosine", # instead of "linear" seed=1337, output_dir="wayland-files/models", report_to="wandb", # Log report to W&B ``` Loss `1.22` Training Results [](https://huggingface.co/Evolany-AI/Llama-3-8b-JP-Article-Summarization-4bit-v0.2/resolve/main/loss.png) **Interernce Code** ```python from unsloth import FastLanguageModel import os import torch max_seq_length = 4096 # 2048 dtype = None load_in_4bit = True model, tokenizer = FastLanguageModel.from_pretrained( model_name="Evolany-AI/Llama-3-8b-JP-Article-Summarization-4bit-v0.2", max_seq_length=max_seq_length, dtype=dtype, load_in_4bit=load_in_4bit, device_map="cuda", attn_implementation="flash_attention_2" ) FastLanguageModel.for_inference(model) alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: {} ### Input: {} ### Response: {}""" instruction = """ 製品、会社、および主要な関連用語について簡潔な説明を提供してください。 """ input = """ """ inputs = tokenizer( [ alpaca_prompt.format( instruction, input, "", ) ], return_tensors="pt").to("cuda") from transformers import TextStreamer text_streamer = TextStreamer(tokenizer, skip_prompt=True) _ = model.generate(**inputs, streamer=text_streamer, max_new_tokens=512) ``` This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library. [](https://github.com/unslothai/unsloth)