/ Модель

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

Контекст
1 024 токена
Лицензия
OpenRAIL
Архитектура
gpt2 · dense
Опубликована
16 мая 2023

gpt2-medium-conversational

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

Экспериментальная версия GPT-2, дообученная для генерации коротких разговорных ответов на английском языке.

2 042скачиваний за 30 дней2лайкавеса обновлены1 авг 2023

Бенчмарки

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

Тесты пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Locutusque/gpt2-medium-conversational — экспериментальная разговорная языковая модель на архитектуре GPT-2, дообученная автором на диалогах пользователя с ИИ-ассистентом. Она предназначена для генерации текстовых ответов в чат-ботах, виртуальных помощниках и службах поддержки; репозиторий содержит неполную версию модели, поскольку полная версия была утрачена. По данным карточки, обучение проводилось на 302 тысячах примеров в течение 502 505 шагов; контекст модели составляет 1024 токена. Модель принимает текст и генерирует текст, а карточка указывает английский язык. Заявлены форматы PyTorch и Safetensors и лицензия OpenRAIL.

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

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

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

Ограничения

В репозитории размещена неполная версия, а ответы могут быть нерелевантными или бессмысленными. Модель не поддерживает историю диалога и не предназначена для надёжных ответов на вопросы, требующие фактических знаний.

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

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

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

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

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

Открыть на Hugging Face

Model Card

Model Details

  • Model Name: gpt2-medium-conversational (prototype)
  • Model Type: Language Modeling
  • Task: Generating Conversational Responses
  • Hardware: 1x RTX 3060
  • Description: This model is trained on a dataset of conversations between a user and an AI assistant, with the goal of generating a coherent and relevant response to the user's input. It uses the GPT-2 architecture, a state-of-the-art transformer-based language model that is capable of generating high-quality text with a wide range of styles and tones. The model is fine-tuned on the conversational data using maximum likelihood estimation, and is evaluated based on its ability to generate responses that are both grammatically correct and semantically relevant to the user's input.
  • Unfortunately, this is not the full model. The full model had much better performance but no longer exists due to a data loss incident.

Intended Use

This model is intended to be used for generating conversational responses in a variety of contexts, such as chatbots, virtual assistants, and customer service applications. It is designed to provide natural and engaging responses to user input, with a focus on maintaining a consistent tone and style throughout the conversation. The model is suitable for use in both text-based and voice-based interfaces, and can be easily integrated into existing applications using the PyTorch and Transformers frameworks.

Training Data

The model is trained on a large dataset of conversational data, consisting of interactions between users and an AI assistant. The data is preprocessed to remove any sensitive information and is formatted in a way that is suitable for training a language model. The training data is split into a training set and a validation set, with the training set used to update the model parameters and the validation set used to evaluate the model performance. The model was trained on 302,000 examples over 502,505 steps, it achieved decent metrics.

Model Architecture

The model architecture used in this model is GPT-2, a transformer-based language model that is capable of generating high-quality text with a wide range of styles and tones. The GPT-2 architecture consists of a multi-layered decoder-only transformer, with self-attention mechanisms that allow the model to capture long-term dependencies and generate coherent text.

Evaluation Metrics

The model is evaluated based on several metrics, including loss, reward, penalty, BLEU score, and perplexity. The loss metric is calculated during training and reflects the difference between the predicted output and the actual output. The reward metric is based on the number of correct words generated by the model, while the penalty metric penalizes the model for repeating words consecutively. The BLEU score measures the similarity between the generated text and the ground truth text, while the perplexity metric measures how well the model is able to predict the next word in a sequence. During validation, the model achieved the following metrics:

  • BLEU score: 9.7
  • perplexity: 5
  • loss: 1.2

Limitations and Bias

This model is not suitable for all use cases due to its limited training time on a weak computer. As a result, it may produce irrelevant or nonsensical responses. Additionally, it has not been fine-tuned to remember the chat history, is unable to provide follow-up responses, and it does not know the answer to many questions (it was only fine-tuned to respond in a conversational way). For optimal performance, we recommend using a GPU with at least 8GB of VRAM and downloading the model manually instead of using the Transformers library. Here's how you should deploy the model:

import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel
start_token = "<|ASSISTANT|>"
end_token = "<|"
tokenizer = GPT2Tokenizer.from_pretrained('gpt2-medium')
model = GPT2LMHeadModel.from_pretrained('gpt2-medium')
tokenizer.add_special_tokens({'pad_token': '[PAD]'})
tokenizer.add_special_tokens({'eos_token': '<|End|>'})
special_tokens = {
    "additional_special_tokens": ["<|USER|>", "<|SYSTEM|>", "<|ASSISTANT|>"]
}
tokenizer.add_special_tokens(special_tokens)
model.resize_token_embeddings(len(tokenizer))
model.load_state_dict(torch.load("path/to/model"))
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
def generate_text(model, tokenizer, prompt, max_length=256):
    prompt = f'<|USER|> {prompt} <|ASSISTANT|> '
    input_ids = tokenizer.encode(prompt, add_special_tokens=True, return_tensors="pt").to(device)
    attention_mask = torch.ones_like(input_ids).to(device)
    output = model.generate(input_ids, 
                            max_length=max_length, 
                            do_sample=True, 
                            top_k=35, 
                            top_p=0.80,
                            pad_token_id=tokenizer.pad_token_id,
                            eos_token_id=tokenizer.eos_token_id,
                            attention_mask=attention_mask)
    output_ids = tokenizer.decode(output[0], skip_special_tokens=False)
    return output_ids
# Loop to interact with the model
while True:
    prompt = input("Enter a prompt (or 'q' to quit): ")
    if prompt == "q":
        break
    output_text = generate_text(model, tokenizer, prompt)
    text_between_tokens = output_text[output_text.find(start_token) + len(start_token):]
    out = text_between_tokens[:text_between_tokens.find(end_token)]
    print(out)

Deploying and training the model

The model has been fine-tuned on a specific input format that goes like this "<|USER|> {user prompt} <|ASSISTANT|> {model prediction} <|End|>". For the best performance from the model the input text should be as follows <|USER|> {dataset prompt} <|ASSISTANT|> and the target/label should be as follows <|USER|> {dataset prompt} <|ASSISTANT|> {dataset output} <|End|>

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
GPT2LMHeadModel
Ревизия весов
853ceb9

0 моделей