--- license: other language: - ja ---

Nekoqarasu

[nekoqarasu-14b-chat](p1atdev/nekoqarasu-14b-chat) = [rinna/nekomata-14b](https://huggingface.co/rinna/nekomata-14b) + [lightblue/qarasu-14B-chat-plus-unleashed](https://huggingface.co/lightblue/qarasu-14B-chat-plus-unleashed) - [Qwen/Qwen-14B](https://huggingface.co/Qwen/Qwen-14B) ## Example ```bash pip install accelerate transformers tiktoken einops scipy transformers_stream_generator ``` ```py import torch from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer MODEL_NAME = "p1atdev/nekoqarasu-14b-chat" tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained( MODEL_NAME, load_in_4bit=True, torch_dtype=torch.float16, device_map="auto", trust_remote_code=True, ) model.eval() # model = torch.compile(model) # recommended if you're using linux streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True) prompt = """\ # system 誠実で紳士的で優秀なAIアシスタントとして、簡潔でわかりやすく役に立つ回答を自信をもって答えなさい。 # question まどか☆マギカでは誰が一番かわいい? # answer """ input_ids = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device) _ = model.generate( **input_ids, max_new_tokens=256, do_sample=True, top_k=20, top_p=0.95, temperature=1.0, repetition_penalty=1.1, num_beams=1, eos_token_id=151643, pad_token_id=151643, streamer=streamer ) ``` The output: ``` この問題は主観的な評価に基づくため、個人の好みや考え方によって異なることがあります。しかし、一般的に「まどか☆マギカ」の登場人物の中で最も可愛いとされるのは、鹿目まどか(かなめ まどか)です。彼女は純粋で優しい性格でありながら、他のキャラクターたちとは一味違う可愛らしさを持っています。 ただし、「可愛い」という基準には個人差があり、同じ作品に対する感覚や好みも異なることがあります。そのため、特定のキャラクターを選ぶだけでなく、複数のキャラクターから好きな要素を見つけたり、全体的に楽しむことが大切だと思います。 ``` ## Merge process See [merge.ipynb](https://huggingface.co/p1atdev/nekoqarasu-14b-chat/blob/main/merge.ipynb). (this worked on 8GB VRAM GPU) ## Features - Fluent Japanese responses - Good knowledge of common sense in Japanese culture ## Limitation - This model often generates too long responses, that are not related to user's instructions or questions. Also, this model does not seem to know how to end a text. - Due to these issues, ChatML format prompt works worse compared to other Qwen based models, such as Qwen-Chat or Qarasu. - Since I have not measured any benchmarks, this model cannot be quantitatively evaluated. ## License [Tongyi Qianwen LICENSE AGREEMENT](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT)