stabilityai / japanese-stablelm-instruct-alpha-7b-v2

huggingface.co
Total runs: 220
24-hour runs: 7
7-day runs: 27
30-day runs: -106
Model's Last Updated: 2023年10月6日
text-generation

Introduction of japanese-stablelm-instruct-alpha-7b-v2

Model Details of japanese-stablelm-instruct-alpha-7b-v2

Japanese-StableLM-Instruct-Alpha-7B-v2

japanese-stablelm-icon

"A parrot able to speak Japanese, ukiyoe, edo period" — Stable Diffusion XL

Model Description

japanese-stablelm-instruct-alpha-7b-v2 is a 7B parameter decoder-only language models pre-trained built on top of the Japanese-StableLM-Base-Alpha-7B model and further fine-tuned on various instruction-following datasets.

Usage

First install additional dependencies in requirements.txt :

pip install sentencepiece einops

Then start generating text with japanese-stablelm-instruct-alpha-7b-v2 by using the following code snippet:

import torch
from transformers import LlamaTokenizer, AutoModelForCausalLM

tokenizer = LlamaTokenizer.from_pretrained(
    "novelai/nerdstash-tokenizer-v1", additional_special_tokens=["▁▁"]
)
model = AutoModelForCausalLM.from_pretrained(
    "stabilityai/japanese-stablelm-instruct-alpha-7b-v2",
    trust_remote_code=True,
    torch_dtype=torch.float16,
    variant="fp16",
)
model.eval()

if torch.cuda.is_available():
    model = model.to("cuda")

def build_prompt(user_query, inputs="", sep="\n\n### "):
    sys_msg = "以下は、タスクを説明する指示と、文脈のある入力の組み合わせです。要求を適切に満たす応答を書きなさい。"
    p = sys_msg
    roles = ["指示", "応答"]
    msgs = [": \n" + user_query, ": \n"]
    if inputs:
        roles.insert(1, "入力")
        msgs.insert(1, ": \n" + inputs)
    for role, msg in zip(roles, msgs):
        p += sep + role + msg
    return p

# Infer with prompt without any additional input
user_inputs = {
    "user_query": "与えられたことわざの意味を小学生でも分かるように教えてください。",
    "inputs": "情けは人のためならず"
}
prompt = build_prompt(**user_inputs)

input_ids = tokenizer.encode(
    prompt, 
    add_special_tokens=False, 
    return_tensors="pt"
)

tokens = model.generate(
    input_ids.to(device=model.device),
    max_new_tokens=256,
    temperature=1,
    top_p=0.95,
    do_sample=True,
)

out = tokenizer.decode(tokens[0][input_ids.shape[1]:], skip_special_tokens=True).strip()
print(out)
"""
「情けは人のためならず」は、「情けをかけるとその人のためにならない」という意味ではありません。
このことわざは、もともと「誰かのために行動するとその行動が回り回って自分に返ってくる」ということを説いたことわざです。
"""
Model Details
  • Model type : japanese-stablelm-instruct-alpha-7b-v2 is an auto-regressive language model based on the NeoX transformer architecture.
  • Language(s) : Japanese
  • Library : GPT-NeoX
  • License : This model is licensed under Apache License, Version 2.0 .
Training
Parameters Hidden Size Layers Heads Sequence Length
7B 4096 32 32 1024
Training Dataset

japanese-stablelm-instruct-alpha-7b-v2 is fine-tuned on a combination of following datasets:

Use and Limitations
Intended Use

This model is intended to be used by the open-source community in chat-like applications in adherence with Apache-2.0 license .

Limitations and bias

Although the aforementioned datasets help to steer the base language models into "safer" distributions of text, not all biases and toxicity can be mitigated through fine-tuning. We ask that users be mindful of such potential issues that can arise in generated responses. Do not treat model outputs as substitutes for human judgment or as sources of truth. Please use responsibly.

Authors
Acknowledgements

We are utilizing the v1 version of the novelai-tokenizer , introduced by NovelAI , because it processes both Japanese and English text both effectively and efficiently. We extend our gratitude to NovelAI for allowing us to use their remarkable work. For more details about the tokenizer, please refer to their blog post .

We are grateful for the contributions of the EleutherAI Polyglot-JA team in helping us to collect a large amount of pre-training data in Japanese. Polyglot-JA members includes Hyunwoong Ko (Project Lead), Fujiki Nakamura (originally started this project when he committed to the Polyglot team), Yunho Mo, Minji Jung, KeunSeok Im, and Su-Kyeong Jang.

We are also appreciative of AI Novelist/Sta (Bit192, Inc.) and the numerous contributors from Stable Community Japan for assisting us in gathering a large amount of high-quality Japanese textual data for model training.

How to cite
@misc{JapaneseStableLMInstructAlpha7Bv2, 
      url={[https://huggingface.co/stabilityai/japanese-stablelm-instruct-alpha-7b-v2](https://huggingface.co/stabilityai/japanese-stablelm-instruct-alpha-7b-v2)}, 
      title={Japanese StableLM Instruct Alpha 7B v2}, 
      author={Lee, Meng and Nakamura, Fujiki and Shing, Makoto and McCann, Paul and Akiba, Takuya and Orii, Naoki}
}
Citations
@misc{alpaca,
  author = {Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto },
  title = {Stanford Alpaca: An Instruction-following LLaMA model},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/tatsu-lab/stanford_alpaca}},
}
@software{gpt-neox-library,
  title = {{GPT-NeoX: Large Scale Autoregressive Language Modeling in PyTorch}},
  author = {Andonian, Alex and Anthony, Quentin and Biderman, Stella and Black, Sid and Gali, Preetham and Gao, Leo and Hallahan, Eric and Levy-Kramer, Josh and Leahy, Connor and Nestler, Lucas and Parker, Kip and Pieler, Michael and Purohit, Shivanshu and Songz, Tri and Phil, Wang and Weinbach, Samuel},
  url = {https://www.github.com/eleutherai/gpt-neox},
  doi = {10.5281/zenodo.5879544},
  month = {8},
  year = {2021},
  version = {0.0.1},
}

Runs of stabilityai japanese-stablelm-instruct-alpha-7b-v2 on huggingface.co

220
Total runs
7
24-hour runs
35
3-day runs
27
7-day runs
-106
30-day runs

More Information About japanese-stablelm-instruct-alpha-7b-v2 huggingface.co Model

More japanese-stablelm-instruct-alpha-7b-v2 license Visit here:

https://choosealicense.com/licenses/apache-2.0

japanese-stablelm-instruct-alpha-7b-v2 huggingface.co

japanese-stablelm-instruct-alpha-7b-v2 huggingface.co is an AI model on huggingface.co that provides japanese-stablelm-instruct-alpha-7b-v2's model effect (), which can be used instantly with this stabilityai japanese-stablelm-instruct-alpha-7b-v2 model. huggingface.co supports a free trial of the japanese-stablelm-instruct-alpha-7b-v2 model, and also provides paid use of the japanese-stablelm-instruct-alpha-7b-v2. Support call japanese-stablelm-instruct-alpha-7b-v2 model through api, including Node.js, Python, http.

japanese-stablelm-instruct-alpha-7b-v2 huggingface.co Url

https://huggingface.co/stabilityai/japanese-stablelm-instruct-alpha-7b-v2

stabilityai japanese-stablelm-instruct-alpha-7b-v2 online free

japanese-stablelm-instruct-alpha-7b-v2 huggingface.co is an online trial and call api platform, which integrates japanese-stablelm-instruct-alpha-7b-v2's modeling effects, including api services, and provides a free online trial of japanese-stablelm-instruct-alpha-7b-v2, you can try japanese-stablelm-instruct-alpha-7b-v2 online for free by clicking the link below.

stabilityai japanese-stablelm-instruct-alpha-7b-v2 online free url in huggingface.co:

https://huggingface.co/stabilityai/japanese-stablelm-instruct-alpha-7b-v2

japanese-stablelm-instruct-alpha-7b-v2 install

japanese-stablelm-instruct-alpha-7b-v2 is an open source model from GitHub that offers a free installation service, and any user can find japanese-stablelm-instruct-alpha-7b-v2 on GitHub to install. At the same time, huggingface.co provides the effect of japanese-stablelm-instruct-alpha-7b-v2 install, users can directly use japanese-stablelm-instruct-alpha-7b-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

japanese-stablelm-instruct-alpha-7b-v2 install url in huggingface.co:

https://huggingface.co/stabilityai/japanese-stablelm-instruct-alpha-7b-v2

Url of japanese-stablelm-instruct-alpha-7b-v2

japanese-stablelm-instruct-alpha-7b-v2 huggingface.co Url

Provider of japanese-stablelm-instruct-alpha-7b-v2 huggingface.co

stabilityai
ORGANIZATIONS

Other API from stabilityai

huggingface.co

Total runs: 417.3K
Run Growth: -16.6K
Growth Rate: -3.99%
Updated: 2024年7月10日
huggingface.co

Total runs: 143.2K
Run Growth: 8.3K
Growth Rate: 5.81%
Updated: 2023年8月4日
huggingface.co

Total runs: 137.2K
Run Growth: 16.4K
Growth Rate: 11.93%
Updated: 2024年7月10日
huggingface.co

Total runs: 34.3K
Run Growth: 3.4K
Growth Rate: 10.04%
Updated: 2024年8月9日
huggingface.co

Total runs: 378
Run Growth: -97.9K
Growth Rate: -25898.41%
Updated: 2024年8月3日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 2024年7月10日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: 2024年4月13日