Views
No views yet
pip install hf-hub-ctranslate2>=2.0.8 ctranslate2>=3.14.0ct2-transformers-converter --model mosaicml/mpt-7b-chat --output_dir /home/michael/tmp-ct2fast-mpt-7b-chat --force --copy_files tokenizer.json README.md tokenizer_config.json generation_config.json special_tokens_map.json .gitattributes --quantization float16 --trust_remote_codecompute_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-mpt-7b-chat"
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("mosaicml/mpt-7b-chat")
12)
13outputs = model.generate(
14 text=["How do you call a fast Flan-ingo?", "User: How are you doing? Bot:"],
15 max_length=64,
16 include_prompt_in_result=False
17)
18print(outputs)I want you to come up with a tweet based on this summary of the article: "Introducing MPT-7B, the latest entry in our MosaicML Foundation Series. MPT-7B is a transformer trained from scratch on IT tokens of text and code. It is open source and it matches the quality of LLaMA-7B. MPT-7B was trained on the MosaicML platform in 9.5 days with zero human intervention at a cost of ~$200k. Starting today, you can train, finetune, and deploy your own private MPT models, either starting from one of our checkpoints or training from scratch. For inspiration, we are also releasing three finetuned models in addition to the base MPT-7B: MPT-7B-Instruct, MPT-7B-Chat, and MPT-7B-Story Writer-65k+, the last of which uses a context length of 65k tokens!
Here's my suggestion for a tweet: "Exciting news! @MosaicML has launched #MPT_7B - a new standard for open-source LLMs. With training on 17 tokens of text & code, it matches the quality of LLaMA-7B. Now you can train, fine-tune, and deploy your own private MPT models via their platform. Check out the full blog post here: https://bit.ly/3j6UJzZ"
Is there anything you want to say to MosaicML about this exciting news?
As an Al language model myself, I am very impressed with the advancements made by MosaicML in developing such high-quality open-source LLMs. This new version of MPT-7B is truly impressive and I look forward to seeing what innovative applications developers will create using these powerful tools. Thank you for your hard work and dedication to advancing Al research and development.
1import transformers
2model = transformers.AutoModelForCausalLM.from_pretrained(
3 'mosaicml/mpt-7b-chat',
4 trust_remote_code=True
5)trust_remote_code=True be passed to the from_pretrained method.
This is because we use a custom MPT model architecture that is not yet part of the Hugging Face transformers package.
MPT includes options for many training efficiency features such as FlashAttention, ALiBi, QK LayerNorm, and more.attn_impl='triton' and move the model to bfloat16:1config = transformers.AutoConfig.from_pretrained(
2 'mosaicml/mpt-7b-chat',
3 trust_remote_code=True
4)
5config.attn_config['attn_impl'] = 'triton'
6
7model = transformers.AutoModelForCausalLM.from_pretrained(
8 'mosaicml/mpt-7b-chat',
9 config=config,
10 torch_dtype=torch.bfloat16,
11 trust_remote_code=True
12)
13model.to(device='cuda:0')1config = transformers.AutoConfig.from_pretrained(
2 'mosaicml/mpt-7b-chat',
3 trust_remote_code=True
4)
5config.update({"max_seq_len": 4096})
6model = transformers.AutoModelForCausalLM.from_pretrained(
7 'mosaicml/mpt-7b-chat',
8 config=config,
9 trust_remote_code=True
10)1from transformers import AutoTokenizer
2tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-neox-20b")| Hyperparameter | Value |
|---|---|
| n_parameters | 6.7B |
| n_layers | 32 |
| n_heads | 32 |
| d_model | 4096 |
| vocab size | 50432 |
| sequence length | 2048 |
@online{MosaicML2023Introducing,
author = {MosaicML NLP Team},
title = {Introducing MPT-7B: A New Standard for Open-Source,
ly Usable LLMs},
year = {2023},
url = {www.mosaicml.com/blog/mpt-7b},
note = {Accessed: 2023-03-28}, % change this date
urldate = {2023-03-28} % change this date
}