/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
10,9 млрд
Размер весов
4,2 ГБ
Лицензия
Apache 2.0
Архитектура
RefinedWebModel · dense
Опубликована
5 июл 2023

tiiuae-falcon-7b-instruct-w4-g64-awq

Генерация текстаТекст → текст7 профессий

Квантизированная до 4 бит версия Falcon-7B-Instruct для генерации текста по запросам и инструкциям с меньшими требованиями к памяти.

37скачиваний за 30 дней5лайковвеса обновлены12 сен 2023

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это 4-битная AWQ-квантизированная версия Falcon-7B-Instruct, разработанной Technology Innovation Institute (TII). Исходная модель — причинный декодер RefinedWebModel с архитектурой RWForCausalLM; автор карточки указывает 7 млрд параметров, а метаданные репозитория — 10,9 млрд параметров. Модель дообучена на наборах данных для чатов и инструкций и предназначена для генерации текста в ответ на запросы и инструкции.

Квантизация использует групповой размер 64 и рассчитана на сокращение требований к памяти при запуске. В README указана проверка на NVIDIA GPU с compute capability 8.0 или выше; приведено сравнение perplexity на Wikitext до и после квантизации. Репозиторий распространяется по лицензии Apache-2.0. Карточка не приводит сведений о поддерживаемых языках или длине контекста.

Сценарии применения

  • генерация ответов на пользовательские вопросы
  • выполнение текстовых инструкций
  • создание диалогового прототипа на локальном GPU

Ограничения

Для запуска с AWQ требуется NVIDIA GPU с compute capability 8.0 или выше. В README приведён лишь ограниченный результат оценки на Wikitext; язык и длина контекста не охарактеризованы.

Для каких профессий подходит7

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Falcon-7B-Instruct (4-bit 64g AWQ Quantized)

Falcon-7B-Instruct is a 7B parameters causal decoder-only model built by TII based on Falcon-7B and finetuned on a mixture of chat/instruct datasets.

This model is a 4-bit 64 group size AWQ quantized model. For more information about AWQ quantization, please click here.

Model Date

July 5, 2023

Model License

Please refer to original Falcon model license (link).

Please refer to the AWQ quantization license (link).

CUDA Version

This model was successfully tested on CUDA driver v530.30.02 and runtime v11.7 with Python v3.10.11. Please note that AWQ requires NVIDIA GPUs with compute capability of 8.0 or higher.

How to Use

git clone https://github.com/mit-han-lab/llm-awq \
&& cd llm-awq \
&& git checkout f084f40bd996f3cf3a0633c1ad7d9d476c318aaa \
&& pip install -e . \
&& cd awq/kernels \
&& python setup.py install
import time
import torch
from awq.quantize.quantizer import real_quantize_model_weight
from transformers import AutoModelForCausalLM, AutoConfig, AutoTokenizer, TextStreamer
from accelerate import init_empty_weights, load_checkpoint_and_dispatch
from huggingface_hub import snapshot_download

model_name = "abhinavkulkarni/tiiuae-falcon-7b-instruct-w4-g64-awq"

# Config
config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)

# Tokenizer
try:
    tokenizer = AutoTokenizer.from_pretrained(config.tokenizer_name, trust_remote_code=True)
except:
    tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False, trust_remote_code=True)
streamer = TextStreamer(tokenizer, skip_special_tokens=True)

# Model
w_bit = 4
q_config = {
    "zero_point": True,
    "q_group_size": 64,
}

load_quant = snapshot_download(model_name)

with init_empty_weights():
    model = AutoModelForCausalLM.from_config(config=config, 
                                                 torch_dtype=torch.float16, trust_remote_code=True)

real_quantize_model_weight(model, w_bit=w_bit, q_config=q_config, init_only=True)
model.tie_weights()

model = load_checkpoint_and_dispatch(model, load_quant, device_map="balanced")

# Inference
prompt = f'''What is the difference between nuclear fusion and fission?
###Response:'''

input_ids = tokenizer(prompt, return_tensors='pt').input_ids.cuda()
output = model.generate(
    inputs=input_ids, 
    temperature=0.7,
    max_new_tokens=512,
    top_p=0.15,
    top_k=0,
    repetition_penalty=1.1,
    eos_token_id=tokenizer.eos_token_id,
    streamer=streamer)

Evaluation

This evaluation was done using LM-Eval.

Falcon-7B-Instruct

TaskVersionMetricValueStderr
wikitext1word_perplexity14.5069
byte_perplexity1.6490
bits_per_byte0.7216

Falcon-7B-Instruct (4-bit 64-group AWQ)

TaskVersionMetricValueStderr
wikitext1word_perplexity14.8667
byte_perplexity1.6566
bits_per_byte0.7282

Acknowledgements

Paper coming soon 😊. In the meanwhile, you can use the following information to cite:

@article{falcon40b,
  title={{Falcon-40B}: an open large language model with state-of-the-art performance},
  author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Debbah, Merouane and Goffinet, Etienne and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
  year={2023}
}

The model was quantized with AWQ technique. If you find AWQ useful or relevant to your research, please kindly cite the paper:

@article{lin2023awq,
  title={AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration},
  author={Lin, Ji and Tang, Jiaming and Tang, Haotian and Yang, Shang and Dang, Xingyu and Han, Song},
  journal={arXiv},
  year={2023}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

vLLM

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
RWForCausalLM
Ревизия весов
b93e1e5

0 моделей