/ Модель

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

Архитектура
gpt_bigcode_ct2fast · dense
Библиотека
transformers
Опубликована
18 июн 2023

ct2fast-starcoderplus

Генерация текстаТекст → текст4 профессии
150скачиваний за 30 дней0лайковвеса обновлены18 июн 2023

Описание модели

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

Версия StarCoderPlus для инференса через CTranslate2 предназначена для генерации и заполнения пропусков в программном коде.

piratos/ct2fast-starcoderplus — версия StarCoderPlus, подготовленная для ускоренного инференса с CTranslate2. README описывает StarCoderPlus как дообученную на StarCoderBase языковую модель с архитектурой GPT-2 и Multi Query Attention, размером 15,5 млрд параметров и контекстом 8192 токена. Модель обучалась на английском тексте и коде более чем на 80 языках программирования, используя цель Fill-in-the-Middle.

Модель подходит для продолжения кода и заполнения пропусков в коде; README отмечает, что базовый вариант не настроен на выполнение инструкций. CTranslate2 позволяет ускорить инференс и снизить потребление памяти за счёт int8-вычислений на CPU или GPU. Сгенерированный код может содержать ошибки, неэффективные решения или уязвимости, а также дословные фрагменты обучающих данных, поэтому его нужно проверять и учитывать требования лицензий исходного кода. README не сообщает лицензию этой копии.

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

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

Ограничения

Базовая модель не настроена на выполнение инструкций; качество работы с неанглийским текстом может быть ограничено. Сгенерированный код может содержать ошибки, уязвимости или фрагменты обучающих данных, требующие проверки и соблюдения лицензий.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

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

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

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

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

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

Открыть на Hugging Face

# Fast-Inference with Ctranslate2

Speedup inference while reducing memory by 2x-4x using int8 inference in C++ on CPU or GPU.

quantized version of bigcode/starcoderplus

pip install hf-hub-ctranslate2>=2.0.10 ctranslate2>=3.16.0

Converted on 2023-06-18 using

ct2-transformers-converter --model bigcode/starcoderplus --output_dir ./ct2fast-starcoder --force --copy_files merges.txt tokenizer.json README.md tokenizer_config.json vocab.json generation_config.json special_tokens_map.json .gitattributes --quantization int8_float16 --trust_remote_code

Checkpoint compatible to ctranslate2>=3.16.0 and hf-hub-ctranslate2>=2.0.10

  • compute_type=int8_float16 for device="cuda"
  • compute_type=int8 for device="cpu"
from hf_hub_ctranslate2 import TranslatorCT2fromHfHub, GeneratorCT2fromHfHub
from transformers import AutoTokenizer
model_name = "piratos/ct2fast-starcoderplus"
# use either TranslatorCT2fromHfHub or GeneratorCT2fromHfHub here, depending on model.
model = GeneratorCT2fromHfHub(
        # load in int8 on CUDA
        model_name_or_path=model_name,
        device="cuda",
        compute_type="int8_float16",
        # tokenizer=AutoTokenizer.from_pretrained("bigcode/starcoderplus")
)
outputs = model.generate(
    text=["def fibonnaci(", "User: How are you doing? Bot:"],
    max_length=64,
    include_prompt_in_result=False
)
print(outputs)

Licence and other remarks:

This is just a quantized version. Licence conditions are intended to be idential to original huggingface repo.

Original description

StarCoderPlus

Play with the instruction-tuned StarCoderPlus at StarChat-Beta.

Table of Contents

  1. Model Summary
  2. Use
  3. Limitations
  4. Training
  5. License
  6. Citation

Model Summary

StarCoderPlus is a fine-tuned version of StarCoderBase on 600B tokens from the English web dataset RedefinedWeb combined with StarCoderData from The Stack (v1.2) and a Wikipedia dataset. It's a 15.5B parameter Language Model trained on English and 80+ programming languages. The model uses Multi Query Attention, a context window of 8192 tokens, and was trained using the Fill-in-the-Middle objective on 1.6 trillion tokens.

Use

Intended use

The model was trained on English and GitHub code. As such it is not an instruction model and commands like "Write a function that computes the square root." do not work well. However, the instruction-tuned version in StarChat makes a capable assistant.

Feel free to share your generations in the Community tab!

Generation

# pip install -q transformers
from transformers import AutoModelForCausalLM, AutoTokenizer

checkpoint = "bigcode/starcoderplus"
device = "cuda" # for GPU usage or "cpu" for CPU usage

tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

inputs = tokenizer.encode("def print_hello_world():", return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))

Fill-in-the-middle

Fill-in-the-middle uses special tokens to identify the prefix/middle/suffix part of the input and output:

input_text = "<fim_prefix>def print_hello_world():\n    <fim_suffix>\n    print('Hello world!')<fim_middle>"
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))

Attribution & Other Requirements

The training code dataset of the model was filtered for permissive licenses only. Nevertheless, the model can generate source code verbatim from the dataset. The code's license might require attribution and/or other specific requirements that must be respected. We provide a search index that let's you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.

Limitations

The model has been trained on a mixture of English text from the web and GitHub code. Therefore it might encounter limitations when working with non-English text, and can carry the stereotypes and biases commonly encountered online. Additionally, the generated code should be used with caution as it may contain errors, inefficiencies, or potential vulnerabilities. For a more comprehensive understanding of the base model's code limitations, please refer to See StarCoder paper.

Training

StarCoderPlus is a fine-tuned version on 600B English and code tokens of StarCoderBase, which was pre-trained on 1T code tokens. Below are the fine-tuning details:

Model

  • Architecture: GPT-2 model with multi-query attention and Fill-in-the-Middle objective
  • Finetuning steps: 150k
  • Finetuning tokens: 600B
  • Precision: bfloat16

Hardware

  • GPUs: 512 Tesla A100
  • Training time: 14 days

Software

License

The model is licensed under the BigCode OpenRAIL-M v1 license agreement. You can find the full agreement here.

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

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

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Ревизия весов
7c8e94e

0 моделей