初始化项目,由ModelHub XC社区提供模型
Model: TheBloke/StableBeluga-7B-GPTQ Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
28
LICENSE.txt
Normal file
28
LICENSE.txt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT
|
||||||
|
Dated: July 27, 2023
|
||||||
|
|
||||||
|
"Agreement" means the terms and conditions for use, reproduction, distribution and modification of the Software Products set forth herein.
|
||||||
|
|
||||||
|
“Documentation” means any specifications, manuals, documentation, and other written information provided by Stability AI related to the Software.
|
||||||
|
|
||||||
|
"Licensee" or "you" means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity's behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
|
||||||
|
|
||||||
|
"Stability AI" or "we" means Stability AI Ltd.
|
||||||
|
|
||||||
|
"Software" means, collectively, Stability AI’s proprietary Stability Beluga 1 and 2 made available under this Agreement.
|
||||||
|
|
||||||
|
“Software Products” means Software and Documentation.
|
||||||
|
|
||||||
|
By using or distributing any portion or element of the Software Products, you agree to be bound by this Agreement.
|
||||||
|
|
||||||
|
License Rights and Redistribution.
|
||||||
|
Stability AI grants you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty free and limited license under Stability AI’s intellectual property or other rights owned by Stability AI embodied in the Software Products to reproduce, distribute, and create derivative works of the Software Products for purposes other than commercial or production use.
|
||||||
|
b. If you distribute or make the Software Products, or any derivative works thereof, available to a third party, you shall (i) provide a copy of this Agreement to such third party, and (ii) retain the following attribution notice within a "Notice" text file distributed as a part of such copies: "Stability Beluga is licensed under the Stability Beluga Research License, Copyright (c) Stability AI Ltd. All Rights Reserved.”
|
||||||
|
c. The licenses granted to you under this Agreement are conditioned upon your compliance with the Documentation, this Agreement, and the Llama 2 Acceptable Use Policy available at ai.meta.com/llama/use-policy, which is hereby incorporated herein by reference, and whose restrictions will apply to both Llama 2 and the Software Products for purposes of this Agreement.
|
||||||
|
2. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE SOFTWARE PRODUCTS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE SOFTWARE PRODUCTS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE SOFTWARE PRODUCTS AND ANY OUTPUT AND RESULTS.
|
||||||
|
3. Limitation of Liability. IN NO EVENT WILL STABILITY AI OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF STABILITY AI OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
|
||||||
|
3. Intellectual Property.
|
||||||
|
a. No trademark licenses are granted under this Agreement, and in connection with the Software Products, neither Stability AI nor Licensee may use any name or mark owned by or associated with the other or any of its affiliates, except as required for reasonable and customary use in describing and redistributing the Software Products.
|
||||||
|
Subject to Stability AI’s ownership of the Software Products and derivatives made by or for Stability AI, with respect to any derivative works and modifications of the Software Products that are made by you, as between you and Stability AI, you are and will be the owner of such derivative works and modifications.
|
||||||
|
If you institute litigation or other proceedings against Stability AI (including a cross-claim or counterclaim in a lawsuit) alleging that the Software Products or associated outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Stability AI from and against any claim by any third party arising out of or related to your use or distribution of the Software Products in violation of this Agreement.
|
||||||
|
4. Term and Termination. The term of this Agreement will commence upon your acceptance of this Agreement or access to the Software Products and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Stability AI may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the Software Products. Sections 2-4 shall survive the termination of this Agreement.
|
||||||
1
Notice
Normal file
1
Notice
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Llama 2 is licensed under the LLAMA 2 Community License, Copyright © Meta Platforms, Inc. All Rights Reserved.
|
||||||
365
README.md
Normal file
365
README.md
Normal file
@@ -0,0 +1,365 @@
|
|||||||
|
---
|
||||||
|
language:
|
||||||
|
- en
|
||||||
|
license: llama2
|
||||||
|
datasets:
|
||||||
|
- conceptofmind/cot_submix_original
|
||||||
|
- conceptofmind/flan2021_submix_original
|
||||||
|
- conceptofmind/t0_submix_original
|
||||||
|
- conceptofmind/niv2_submix_original
|
||||||
|
model_name: StableBeluga 7B
|
||||||
|
base_model: stabilityai/StableBeluga-7b
|
||||||
|
inference: false
|
||||||
|
model_creator: Stability AI
|
||||||
|
model_type: llama
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
prompt_template: '### System:
|
||||||
|
|
||||||
|
{system_message}
|
||||||
|
|
||||||
|
|
||||||
|
### User:
|
||||||
|
|
||||||
|
{prompt}
|
||||||
|
|
||||||
|
|
||||||
|
### Assistant:
|
||||||
|
|
||||||
|
'
|
||||||
|
quantized_by: TheBloke
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- header start -->
|
||||||
|
<!-- 200823 -->
|
||||||
|
<div style="width: auto; margin-left: auto; margin-right: auto">
|
||||||
|
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; justify-content: space-between; width: 100%;">
|
||||||
|
<div style="display: flex; flex-direction: column; align-items: flex-start;">
|
||||||
|
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex; flex-direction: column; align-items: flex-end;">
|
||||||
|
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
|
||||||
|
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
|
||||||
|
<!-- header end -->
|
||||||
|
|
||||||
|
# StableBeluga 7B - GPTQ
|
||||||
|
- Model creator: [Stability AI](https://huggingface.co/stabilityai)
|
||||||
|
- Original model: [StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b)
|
||||||
|
|
||||||
|
<!-- description start -->
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This repo contains GPTQ model files for [Stability AI's StableBeluga 7B](https://huggingface.co/stabilityai/StableBeluga-7b).
|
||||||
|
|
||||||
|
Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
|
||||||
|
|
||||||
|
<!-- description end -->
|
||||||
|
<!-- repositories-available start -->
|
||||||
|
## Repositories available
|
||||||
|
|
||||||
|
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/StableBeluga-7B-AWQ)
|
||||||
|
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ)
|
||||||
|
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/StableBeluga-7B-GGUF)
|
||||||
|
* [Stability AI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/stabilityai/StableBeluga-7b)
|
||||||
|
<!-- repositories-available end -->
|
||||||
|
|
||||||
|
<!-- prompt-template start -->
|
||||||
|
## Prompt template: Orca-Hashes
|
||||||
|
|
||||||
|
```
|
||||||
|
### System:
|
||||||
|
{system_message}
|
||||||
|
|
||||||
|
### User:
|
||||||
|
{prompt}
|
||||||
|
|
||||||
|
### Assistant:
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
<!-- prompt-template end -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- README_GPTQ.md-provided-files start -->
|
||||||
|
## Provided files and GPTQ parameters
|
||||||
|
|
||||||
|
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
|
||||||
|
|
||||||
|
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
|
||||||
|
|
||||||
|
All recent GPTQ files are made with AutoGPTQ, and all files in non-main branches are made with AutoGPTQ. Files in the `main` branch which were uploaded before August 2023 were made with GPTQ-for-LLaMa.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Explanation of GPTQ parameters</summary>
|
||||||
|
|
||||||
|
- Bits: The bit size of the quantised model.
|
||||||
|
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
|
||||||
|
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
|
||||||
|
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
|
||||||
|
- GPTQ dataset: The dataset used for quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
|
||||||
|
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
|
||||||
|
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
|
||||||
|
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
|
||||||
|
| [main](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/main) | 4 | 128 | No | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, without Act Order and group size 128g. |
|
||||||
|
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
|
||||||
|
| [gptq-4bit-64g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-64g-actorder_True) | 4 | 64 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 4.02 GB | Yes | 4-bit, with Act Order and group size 64g. Uses less VRAM than 32g, but with slightly lower accuracy. |
|
||||||
|
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 3.90 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
|
||||||
|
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.01 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
|
||||||
|
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [wikitext](https://huggingface.co/datasets/wikitext/viewer/wikitext-2-v1/test) | 4096 | 7.16 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
|
||||||
|
|
||||||
|
<!-- README_GPTQ.md-provided-files end -->
|
||||||
|
|
||||||
|
<!-- README_GPTQ.md-download-from-branches start -->
|
||||||
|
## How to download from branches
|
||||||
|
|
||||||
|
- In text-generation-webui, you can add `:branch` to the end of the download name, eg `TheBloke/StableBeluga-7B-GPTQ:main`
|
||||||
|
- With Git, you can clone a branch with:
|
||||||
|
```
|
||||||
|
git clone --single-branch --branch main https://huggingface.co/TheBloke/StableBeluga-7B-GPTQ
|
||||||
|
```
|
||||||
|
- In Python Transformers code, the branch is the `revision` parameter; see below.
|
||||||
|
<!-- README_GPTQ.md-download-from-branches end -->
|
||||||
|
<!-- README_GPTQ.md-text-generation-webui start -->
|
||||||
|
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
||||||
|
|
||||||
|
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
|
||||||
|
|
||||||
|
It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
|
||||||
|
|
||||||
|
1. Click the **Model tab**.
|
||||||
|
2. Under **Download custom model or LoRA**, enter `TheBloke/StableBeluga-7B-GPTQ`.
|
||||||
|
- To download from a specific branch, enter for example `TheBloke/StableBeluga-7B-GPTQ:main`
|
||||||
|
- see Provided Files above for the list of branches for each option.
|
||||||
|
3. Click **Download**.
|
||||||
|
4. The model will start downloading. Once it's finished it will say "Done".
|
||||||
|
5. In the top left, click the refresh icon next to **Model**.
|
||||||
|
6. In the **Model** dropdown, choose the model you just downloaded: `StableBeluga-7B-GPTQ`
|
||||||
|
7. The model will automatically load, and is now ready for use!
|
||||||
|
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
|
||||||
|
* Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
|
||||||
|
9. Once you're ready, click the **Text Generation tab** and enter a prompt to get started!
|
||||||
|
<!-- README_GPTQ.md-text-generation-webui end -->
|
||||||
|
|
||||||
|
<!-- README_GPTQ.md-use-from-python start -->
|
||||||
|
## How to use this GPTQ model from Python code
|
||||||
|
|
||||||
|
### Install the necessary packages
|
||||||
|
|
||||||
|
Requires: Transformers 4.32.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip3 install transformers>=4.32.0 optimum>=1.12.0
|
||||||
|
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
|
||||||
|
```
|
||||||
|
|
||||||
|
If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip3 uninstall -y auto-gptq
|
||||||
|
git clone https://github.com/PanQiWei/AutoGPTQ
|
||||||
|
cd AutoGPTQ
|
||||||
|
pip3 install .
|
||||||
|
```
|
||||||
|
|
||||||
|
### For CodeLlama models only: you must use Transformers 4.33.0 or later.
|
||||||
|
|
||||||
|
If 4.33.0 is not yet released when you read this, you will need to install Transformers from source:
|
||||||
|
```shell
|
||||||
|
pip3 uninstall -y transformers
|
||||||
|
pip3 install git+https://github.com/huggingface/transformers.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### You can then use the following code
|
||||||
|
|
||||||
|
```python
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
||||||
|
|
||||||
|
model_name_or_path = "TheBloke/StableBeluga-7B-GPTQ"
|
||||||
|
# To use a different branch, change revision
|
||||||
|
# For example: revision="main"
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
|
||||||
|
device_map="auto",
|
||||||
|
trust_remote_code=False,
|
||||||
|
revision="main")
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
|
||||||
|
|
||||||
|
prompt = "Tell me about AI"
|
||||||
|
prompt_template=f'''### System:
|
||||||
|
{system_message}
|
||||||
|
|
||||||
|
### User:
|
||||||
|
{prompt}
|
||||||
|
|
||||||
|
### Assistant:
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
print("\n\n*** Generate:")
|
||||||
|
|
||||||
|
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
||||||
|
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
||||||
|
print(tokenizer.decode(output[0]))
|
||||||
|
|
||||||
|
# Inference can also be done using transformers' pipeline
|
||||||
|
|
||||||
|
print("*** Pipeline:")
|
||||||
|
pipe = pipeline(
|
||||||
|
"text-generation",
|
||||||
|
model=model,
|
||||||
|
tokenizer=tokenizer,
|
||||||
|
max_new_tokens=512,
|
||||||
|
do_sample=True,
|
||||||
|
temperature=0.7,
|
||||||
|
top_p=0.95,
|
||||||
|
top_k=40,
|
||||||
|
repetition_penalty=1.1
|
||||||
|
)
|
||||||
|
|
||||||
|
print(pipe(prompt_template)[0]['generated_text'])
|
||||||
|
```
|
||||||
|
<!-- README_GPTQ.md-use-from-python end -->
|
||||||
|
|
||||||
|
<!-- README_GPTQ.md-compatibility start -->
|
||||||
|
## Compatibility
|
||||||
|
|
||||||
|
The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
|
||||||
|
|
||||||
|
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama models in 4-bit. Please see the Provided Files table above for per-file compatibility.
|
||||||
|
|
||||||
|
[Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
|
||||||
|
<!-- README_GPTQ.md-compatibility end -->
|
||||||
|
|
||||||
|
<!-- footer start -->
|
||||||
|
<!-- 200823 -->
|
||||||
|
## Discord
|
||||||
|
|
||||||
|
For further support, and discussions on these models and AI in general, join us at:
|
||||||
|
|
||||||
|
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
|
||||||
|
|
||||||
|
## Thanks, and how to contribute
|
||||||
|
|
||||||
|
Thanks to the [chirper.ai](https://chirper.ai) team!
|
||||||
|
|
||||||
|
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
|
||||||
|
|
||||||
|
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
|
||||||
|
|
||||||
|
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
|
||||||
|
|
||||||
|
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
|
||||||
|
|
||||||
|
* Patreon: https://patreon.com/TheBlokeAI
|
||||||
|
* Ko-Fi: https://ko-fi.com/TheBlokeAI
|
||||||
|
|
||||||
|
**Special thanks to**: Aemon Algiz.
|
||||||
|
|
||||||
|
**Patreon special mentions**: Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bjäreholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, 준교 김, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, 阿明, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
|
||||||
|
|
||||||
|
|
||||||
|
Thank you to all my generous patrons and donaters!
|
||||||
|
|
||||||
|
And thank you again to a16z for their generous grant.
|
||||||
|
|
||||||
|
<!-- footer end -->
|
||||||
|
|
||||||
|
# Original model card: Stability AI's StableBeluga 7B
|
||||||
|
|
||||||
|
# Stable Beluga 7B
|
||||||
|
|
||||||
|
Use [Stable Chat (Research Preview)](https://chat.stability.ai/chat) to test Stability AI's best language models for free
|
||||||
|
|
||||||
|
## Model Description
|
||||||
|
|
||||||
|
`Stable Beluga 7B` is a Llama2 7B model finetuned on an Orca style Dataset
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Start chatting with `Stable Beluga 7B` using the following code snippet:
|
||||||
|
|
||||||
|
```python
|
||||||
|
import torch
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained("stabilityai/StableBeluga-7B", use_fast=False)
|
||||||
|
model = AutoModelForCausalLM.from_pretrained("stabilityai/StableBeluga-7B", torch_dtype=torch.float16, low_cpu_mem_usage=True, device_map="auto")
|
||||||
|
system_prompt = "### System:\nYou are StableBeluga, an AI that follows instructions extremely well. Help as much as you can. Remember, be safe, and don't do anything illegal.\n\n"
|
||||||
|
|
||||||
|
message = "Write me a poem please"
|
||||||
|
prompt = f"{system_prompt}### User: {message}\n\n### Assistant:\n"
|
||||||
|
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
||||||
|
output = model.generate(**inputs, do_sample=True, top_p=0.95, top_k=0, max_new_tokens=256)
|
||||||
|
|
||||||
|
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
||||||
|
```
|
||||||
|
|
||||||
|
Stable Beluga 7B should be used with this prompt format:
|
||||||
|
```
|
||||||
|
### System:
|
||||||
|
This is a system prompt, please behave and help the user.
|
||||||
|
|
||||||
|
### User:
|
||||||
|
Your prompt here
|
||||||
|
|
||||||
|
### Assistant:
|
||||||
|
The output of Stable Beluga 7B
|
||||||
|
```
|
||||||
|
|
||||||
|
## Model Details
|
||||||
|
|
||||||
|
* **Developed by**: [Stability AI](https://stability.ai/)
|
||||||
|
* **Model type**: Stable Beluga 7B is an auto-regressive language model fine-tuned on Llama2 7B.
|
||||||
|
* **Language(s)**: English
|
||||||
|
* **Library**: [HuggingFace Transformers](https://github.com/huggingface/transformers)
|
||||||
|
* **License**: Fine-tuned checkpoints (`Stable Beluga 7B`) is licensed under the [STABLE BELUGA NON-COMMERCIAL COMMUNITY LICENSE AGREEMENT](https://huggingface.co/stabilityai/StableBeluga-7B/blob/main/LICENSE.txt)
|
||||||
|
* **Contact**: For questions and comments about the model, please email `lm@stability.ai`
|
||||||
|
|
||||||
|
### Training Dataset
|
||||||
|
|
||||||
|
` Stable Beluga 7B` is trained on our internal Orca-style dataset
|
||||||
|
|
||||||
|
### Training Procedure
|
||||||
|
|
||||||
|
Models are learned via supervised fine-tuning on the aforementioned datasets, trained in mixed-precision (BF16), and optimized with AdamW. We outline the following hyperparameters:
|
||||||
|
|
||||||
|
| Dataset | Batch Size | Learning Rate |Learning Rate Decay| Warm-up | Weight Decay | Betas |
|
||||||
|
|-------------------|------------|---------------|-------------------|---------|--------------|-------------|
|
||||||
|
| Orca pt1 packed | 256 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
|
||||||
|
| Orca pt2 unpacked | 512 | 3e-5 | Cosine to 3e-6 | 100 | 1e-6 | (0.9, 0.95) |
|
||||||
|
|
||||||
|
## Ethical Considerations and Limitations
|
||||||
|
|
||||||
|
Beluga is a new technology that carries risks with use. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, Beluga's potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Beluga, developers should perform safety testing and tuning tailored to their specific applications of the model.
|
||||||
|
|
||||||
|
## Citations
|
||||||
|
|
||||||
|
```bibtext
|
||||||
|
@misc{touvron2023llama,
|
||||||
|
title={Llama 2: Open Foundation and Fine-Tuned Chat Models},
|
||||||
|
author={Hugo Touvron and Louis Martin and Kevin Stone and Peter Albert and Amjad Almahairi and Yasmine Babaei and Nikolay Bashlykov and Soumya Batra and Prajjwal Bhargava and Shruti Bhosale and Dan Bikel and Lukas Blecher and Cristian Canton Ferrer and Moya Chen and Guillem Cucurull and David Esiobu and Jude Fernandes and Jeremy Fu and Wenyin Fu and Brian Fuller and Cynthia Gao and Vedanuj Goswami and Naman Goyal and Anthony Hartshorn and Saghar Hosseini and Rui Hou and Hakan Inan and Marcin Kardas and Viktor Kerkez and Madian Khabsa and Isabel Kloumann and Artem Korenev and Punit Singh Koura and Marie-Anne Lachaux and Thibaut Lavril and Jenya Lee and Diana Liskovich and Yinghai Lu and Yuning Mao and Xavier Martinet and Todor Mihaylov and Pushkar Mishra and Igor Molybog and Yixin Nie and Andrew Poulton and Jeremy Reizenstein and Rashi Rungta and Kalyan Saladi and Alan Schelten and Ruan Silva and Eric Michael Smith and Ranjan Subramanian and Xiaoqing Ellen Tan and Binh Tang and Ross Taylor and Adina Williams and Jian Xiang Kuan and Puxin Xu and Zheng Yan and Iliyan Zarov and Yuchen Zhang and Angela Fan and Melanie Kambadur and Sharan Narang and Aurelien Rodriguez and Robert Stojnic and Sergey Edunov and Thomas Scialom},
|
||||||
|
year={2023},
|
||||||
|
eprint={2307.09288},
|
||||||
|
archivePrefix={arXiv},
|
||||||
|
primaryClass={cs.CL}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```bibtext
|
||||||
|
@misc{mukherjee2023orca,
|
||||||
|
title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
|
||||||
|
author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
|
||||||
|
year={2023},
|
||||||
|
eprint={2306.02707},
|
||||||
|
archivePrefix={arXiv},
|
||||||
|
primaryClass={cs.CL}
|
||||||
|
}
|
||||||
|
```
|
||||||
50
USE_POLICY.md
Normal file
50
USE_POLICY.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Llama 2 Acceptable Use Policy
|
||||||
|
|
||||||
|
Meta is committed to promoting safe and fair use of its tools and features, including Llama 2. If you access or use Llama 2, you agree to this Acceptable Use Policy (“Policy”). The most recent copy of this policy can be found at [ai.meta.com/llama/use-policy](http://ai.meta.com/llama/use-policy).
|
||||||
|
|
||||||
|
## Prohibited Uses
|
||||||
|
We want everyone to use Llama 2 safely and responsibly. You agree you will not use, or allow others to use, Llama 2 to:
|
||||||
|
|
||||||
|
1. Violate the law or others’ rights, including to:
|
||||||
|
1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
|
||||||
|
1. Violence or terrorism
|
||||||
|
2. Exploitation or harm to children, including the solicitation, creation, acquisition, or dissemination of child exploitative content or failure to report Child Sexual Abuse Material
|
||||||
|
3. Human trafficking, exploitation, and sexual violence
|
||||||
|
4. The illegal distribution of information or materials to minors, including obscene materials, or failure to employ legally required age-gating in connection with such information or materials.
|
||||||
|
5. Sexual solicitation
|
||||||
|
6. Any other criminal activity
|
||||||
|
2. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
|
||||||
|
3. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services
|
||||||
|
4. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
|
||||||
|
5. Collect, process, disclose, generate, or infer health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws
|
||||||
|
6. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Llama 2 Materials
|
||||||
|
7. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including use of Llama 2 related to the following:
|
||||||
|
1. Military, warfare, nuclear industries or applications, espionage, use for materials or activities that are subject to the International Traffic Arms Regulations (ITAR) maintained by the United States Department of State
|
||||||
|
2. Guns and illegal weapons (including weapon development)
|
||||||
|
3. Illegal drugs and regulated/controlled substances
|
||||||
|
4. Operation of critical infrastructure, transportation technologies, or heavy machinery
|
||||||
|
5. Self-harm or harm to others, including suicide, cutting, and eating disorders
|
||||||
|
6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3. Intentionally deceive or mislead others, including use of Llama 2 related to the following:
|
||||||
|
1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
|
||||||
|
2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
|
||||||
|
3. Generating, promoting, or further distributing spam
|
||||||
|
4. Impersonating another individual without consent, authorization, or legal right
|
||||||
|
5. Representing that the use of Llama 2 or outputs are human-generated
|
||||||
|
6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
|
||||||
|
4. Fail to appropriately disclose to end users any known dangers of your AI system
|
||||||
|
|
||||||
|
Please report any violation of this Policy, software “bug,” or other problems that could lead to a violation of this Policy through one of the following means:
|
||||||
|
|
||||||
|
* Reporting issues with the model: [github.com/facebookresearch/llama](http://github.com/facebookresearch/llama)
|
||||||
|
* Reporting risky content generated by the model: [developers.facebook.com/llama_output_feedback](http://developers.facebook.com/llama_output_feedback)
|
||||||
|
* Reporting bugs and security concerns: [facebook.com/whitehat/info](http://facebook.com/whitehat/info)
|
||||||
|
* Reporting violations of the Acceptable Use Policy or unlicensed uses of Llama: [LlamaUseReport@meta.com](mailto:LlamaUseReport@meta.com)
|
||||||
|
|
||||||
36
config.json
Normal file
36
config.json
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"architectures": [
|
||||||
|
"LlamaForCausalLM"
|
||||||
|
],
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 4096,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 11008,
|
||||||
|
"max_position_embeddings": 4096,
|
||||||
|
"model_type": "llama",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_hidden_layers": 32,
|
||||||
|
"num_key_value_heads": 32,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"pretraining_tp": 1,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_scaling": null,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"torch_dtype": "float16",
|
||||||
|
"transformers_version": "4.32.0.dev0",
|
||||||
|
"use_cache": true,
|
||||||
|
"vocab_size": 32000,
|
||||||
|
"quantization_config": {
|
||||||
|
"bits": 4,
|
||||||
|
"group_size": 128,
|
||||||
|
"damp_percent": 0.1,
|
||||||
|
"desc_act": false,
|
||||||
|
"sym": true,
|
||||||
|
"true_sequential": true,
|
||||||
|
"model_name_or_path": null,
|
||||||
|
"model_file_base_name": "model",
|
||||||
|
"quant_method": "gptq"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||||
7
generation_config.json
Normal file
7
generation_config.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"_from_model_config": true,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"pad_token_id": 0,
|
||||||
|
"transformers_version": "4.32.0.dev0"
|
||||||
|
}
|
||||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c07a726f37d3c6404b17858ea30990e8caaa46f7577a6785c258e6a55d460b8b
|
||||||
|
size 3896726232
|
||||||
10
quantize_config.json
Normal file
10
quantize_config.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"bits": 4,
|
||||||
|
"group_size": 128,
|
||||||
|
"damp_percent": 0.1,
|
||||||
|
"desc_act": false,
|
||||||
|
"sym": true,
|
||||||
|
"true_sequential": true,
|
||||||
|
"model_name_or_path": null,
|
||||||
|
"model_file_base_name": "model"
|
||||||
|
}
|
||||||
23
special_tokens_map.json
Normal file
23
special_tokens_map.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
93391
tokenizer.json
Normal file
93391
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
Binary file not shown.
31
tokenizer_config.json
Normal file
31
tokenizer_config.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"model_max_length": 4096,
|
||||||
|
"pad_token": null,
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"tokenizer_class": "LlamaTokenizer",
|
||||||
|
"unk_token": {
|
||||||
|
"__type": "AddedToken",
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": true,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user