Views
No views yet
pip install hf-hub-ctranslate2>=2.0.8 ct2-transformers-converter --model stabilityai/stablelm-base-alpha-7b --output_dir /home/michael/tmp-ct2fast-stablelm-base-alpha-7b --force --copy_files tokenizer.json README.md tokenizer_config.json generation_config.json special_tokens_map.json .gitattributes --quantization float16compute_type=int8_float16 for device="cuda"compute_type=int8 for device="cpu"1from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
2from transformers import AutoTokenizer
3
4model_name = "michaelfeil/ct2fast-stablelm-base-alpha-7b"
5# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
6model = GeneratorCT2fromHfHub(
7 # load in int8 on CUDA
8 model_name_or_path=model_name,
9 device="cuda",
10 compute_type="int8_float16",
11 # tokenizer=AutoTokenizer.from_pretrained("stabilityai/stablelm-base-alpha-7b")
12)
13outputs = model.generate(
14 text=["def print_hello_world():", "def hello_name(name:"],
15 max_length=64
16)
17print(outputs)StableLM-Base-Alpha is a suite of 3B and 7B parameter decoder-only language models pre-trained on a diverse collection of English datasets with a sequence length of 4096 to push beyond the context window limitations of existing open-source language models.StableLM-Base-Alpha by using the following code snippet:1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("StabilityAI/stablelm-base-alpha-7b")
4model = AutoModelForCausalLM.from_pretrained("StabilityAI/stablelm-base-alpha-7b")
5model.half().cuda()
6
7inputs = tokenizer("What's your mood today?", return_tensors="pt").to("cuda")
8tokens = model.generate(
9 **inputs,
10 max_new_tokens=64,
11 temperature=0.7,
12 do_sample=True,
13)
14print(tokenizer.decode(tokens[0], skip_special_tokens=True))StableLM-Base-Alpha) are licensed under the Creative Commons license (CC BY-SA-4.0). Under the license, you must give credit to Stability AI, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the Stability AI endorses you or your use.lm@stability.ai| Parameters | Hidden Size | Layers | Heads | Sequence Length |
|---|---|---|---|---|
| 3B | 4096 | 16 | 32 | 4096 |
| 7B | 6144 | 16 | 48 | 4096 |
StableLM-Base-Alpha is pre-trained on a new experimental dataset built atop The Pile and is threes times larger at approximately 1.5T tokens.1@software{gpt-neox-library,
2 title = {{GPT-NeoX: Large Scale Autoregressive Language Modeling in PyTorch}},
3 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},
4 url = {https://www.github.com/eleutherai/gpt-neox},
5 doi = {10.5281/zenodo.5879544},
6 month = {8},
7 year = {2021},
8 version = {0.0.1},
9}