--- license: apache-2.0 datasets: - llm-jp/databricks-dolly-15k-ja language: - ja library_name: transformers --- ## モデル - ベースモデル:[llm-jp/llm-jp-1.3b-v1.0](https://huggingface.co/llm-jp/llm-jp-1.3b-v1.0) - 学習データセット:[llm-jp/databricks-dolly-15k-ja](https://huggingface.co/datasets/llm-jp/databricks-dolly-15k-ja) - 学習方式:フルパラメータチューニング ## サンプル ```python import torch from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained( "ryota39/llm-jp-1b-sft-15k" ) pad_token_id = tokenizer.pad_token_id model = AutoModelForCausalLM.from_pretrained( "ryota39/llm-jp-1b-sft-15k", device_map="auto", torch_dtype=torch.float16, ) text = "東京の観光名所を教えてください。\n" tokenized_input = tokenizer.encode( text, add_special_tokens=False, return_tensors="pt" ).to(model.device) attention_mask = torch.ones_like(tokenized_input) attention_mask[tokenized_input == pad_token_id] = 0 with torch.no_grad(): output = model.generate( tokenized_input, attention_mask=attention_mask, max_new_tokens=128, do_sample=False, # top_p=0.8, # temperature=0.8, repetition_penalty=1.0 )[0] print(tokenizer.decode(output)) ```