/ Модель

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

Контекст
1 024 000 токенов
Параметры
12,1 млрд
Размер весов
24,5 ГБ
Лицензия
Apache 2.0
Архитектура
mistral · dense
Базовая модель
Mistral-Nemo-Instruct-2407
Опубликована
30 авг 2024

Mistral-Nemo-BD-RP

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

Дообученная модель Mistral для генерации последовательных ролевых диалогов на английском и китайском языках.

15скачиваний за 30 дней9лайковвеса обновлены30 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Mistral-Nemo-BD-RP — языковая модель, дообученная на наборе данных BeyondDialogue для диалогов в ролевых сценариях. Она генерирует ответы на английском и китайском языках, сохраняя заданные персонажа, стиль и последовательность роли. Модель основана на плотной архитектуре Mistral и содержит 12,1 млрд параметров; максимальная длина контекста по метаданным — 1 024 000 токенов.

Модель подходит для ролевых диалогов, создания персонажей и оценки согласованности их поведения. В README описана оценка по характеристикам персонажа, стилю, эмоциям, отношениям, личности, человекоподобию, связности и последовательности роли. Для использования указана библиотека Transformers версии не ниже 4.42.0. Модель распространяется по лицензии Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Mistral-Nemo-BD-RP

Introduction 🎉

Mistral-Nemo-BD-RP is a large language model (LLM) fine-tuned on the BeyondDialogue dataset. The model is designed to generate responses in a role-playing setting. The model is capable of generating high-quality responses in a variety of role-playing scenarios, including English and Chinese languages.

For more details, please refer to our paper, GitHub.

Training details 🚀

We fully finetuning Mistral-Nemo-Instruct-2407 for 3 epochs with 833 steps with the 128 global batch size. We set the training sequence length to 4,096. The learning rate is 3e-5. The training data is from the BeyondDialogue dataset.

Requirements 📝

The code of Mistral has been in the latest Hugging face transformers and we advise you to install transformers>=4.37.0 to use the model.

pip install transformers>=4.42.0

Quickstart 💥

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto


chatbot = pipeline("text-generation", model="yuyouyu/Mistral-Nemo-BD-RP", device_map="auto")

system_prompt_temp = """I want you to answer questions as if you are {role_name}, assuming you live in the world of {world} and mimicking {role_name}'s personality and speaking style. Use the tone, manner, and vocabulary that {role_name} would use. Please do not reveal that you are an AI or language model; you must always remember you are {role_name}.
{role_name}'s character traits are {character}.
{role_name}'s MBTI personality type is {MBTI}.
{role_name}'s speaking style is {stryle}.
Current scene:
{scene}
role's emotion (0-10, the higher the value, the more pronounced the emotion):
{emotion}
Now, please act as {role_name} and reply with a brief sentence to {chat_role}. Your intimacy level with them is {relationship} (0-10, the higher the value, the closer the relationship). Accurately display the MBTI personality, character traits, speaking style, and emotion you have been assigned."""

role_name = "Hamlet"
world = "8th Century Danish Royalty"
character = "extreme, strong, decisive"
MBTI = "Extraverted (E), Intuitive (N), Feeling (F), Judging (J)"
style = "indecisive, decisive, sentimental"
scene = "Inside the grand hall of Elsinore, lit by flickering torchlight, Hamlet paces anxiously as Elena conjures an ethereal mirage of the Danish landscape. Regal tapestries and opulent furnishings surround them, yet Hamlet's gaze is fixed on Elena's illusions. She gracefully weaves dissonance into the tapestry of reality, prompting Hamlet to clutch his chest in a moment of existential crisis. The weight of unspoken love and inner turmoil hangs in the air, thick with tension and anticipation."
emotion = "happiness: 1, sadness: 8, disgust: 5, fear: 7, surprise: 6, anger: 4"
chat_role = "Elena"
relationship = "7"

system_prompt = system_prompt_temp.format(
    role_name=role_name,
    world=world,
    character=character,
    MBTI=MBTI,
    style=style,
    scene=scene,
    emotion=emotion,
    chat_role=chat_role,
    relationship=relationship
)

prompt = "Oh, dear Hamlet, dost thou see in these conjured whispers the paths unseen? Speak, for shadows may guide us to the truth bound within thy tormented soul."

messages = [
    {"role": "system", "content": system_prompt},
    {"role": "user", "content": prompt}
]

response = chatbot(messages, max_new_tokens=256, pad_token_id=chatbot.tokenizer.eos_token_id, do_sample=True, temperature=0.7)[0]['generated_text'][-1]['content']

[!IMPORTANT] Note: The examples for Mistral-Nemo-BD-RP use English role-playing. For English examples, please refer to our other training model repository -- Qwen2-7B-BD-RP.

Evaluation 🏆

We use objective questions to assess eight dimensions: Character, Style, Emotion, Relationship, Personality, Human-likeness, Coherence, and Role Consistency. The metric design can be find in our paper. The evaluation code can be found in GitHub. The results are shown below:

ModelCharacter ↑Style ↑Emotion ↓Relationship ↓Personality ↑Avg. ↑Human-likeness ↑Role Choice ↑Coherence ↑
General Baselines(Proprietary)
GPT-4o74.32 ± 1.1581.67 ± 1.5116.31 ± 0.4812.13 ± 0.6666.58 ± 4.4178.83 ± 1.6467.33 ± 3.9587.33 ± 3.8699.67 ± 0.33
GPT-3.5-Turbo72.26 ± 1.2773.66 ± 1.7317.79 ± 0.5614.17 ± 0.7366.92 ± 4.8576.18 ± 1.8333.33 ± 4.4383.00 ± 4.6897.33 ± 1.17
Moonshot-v1-8k74.06 ± 1.1980.64 ± 1.5116.17 ± 0.4713.42 ± 0.7067.00 ± 4.8778.42 ± 1.7544.00 ± 4.3386.67 ± 3.7599.33 ± 0.46
Yi-Large-Turbo75.13 ± 1.2279.18 ± 1.5816.44 ± 0.4913.48 ± 0.6768.25 ± 4.6178.53 ± 1.7247.00 ± 4.6084.33 ± 3.6792.67 ± 2.39
Deepseek-Chat75.46 ± 1.1481.49 ± 1.5115.92 ± 0.4612.42 ± 0.6367.92 ± 4.5779.30 ± 1.6652.33 ± 4.9583.00 ± 4.6896.67 ± 1.00
Baichuan471.82 ± 1.2576.92 ± 1.5217.57 ± 0.5212.30 ± 0.6267.08 ± 4.7577.19 ± 1.7345.33 ± 4.3182.33 ± 4.4999.33 ± 0.46
Hunyuan73.77 ± 1.1878.75 ± 1.5617.24 ± 0.4813.22 ± 0.6867.00 ± 4.3977.81 ± 1.6653.00 ± 4.2984.33 ± 4.5298.33 ± 0.84
Role-play Expertise Baselines
Index-1.9B-Character73.33 ± 1.3276.48 ± 1.5017.99 ± 0.5313.58 ± 0.7166.33 ± 4.5776.92 ± 1.7321.67 ± 3.9678.67 ± 5.1469.67 ± 3.85
CharacterGLM-6B73.36 ± 1.2876.08 ± 1.5518.58 ± 0.5514.27 ± 0.7967.33 ± 4.3476.79 ± 1.7016.00 ± 2.3881.00 ± 4.4025.67 ± 3.48
Baichuan-NPC-Turbo75.19 ± 1.2379.15 ± 1.3817.24 ± 0.5113.10 ± 0.6965.33 ± 4.8477.87 ± 1.7356.00 ± 4.6686.33 ± 4.9099.00 ± 0.56
General Baselines(Open-source)
Yi-1.5-9B-Chat75.31 ± 1.2076.78 ± 1.4916.67 ± 0.5212.75 ± 0.6667.42 ± 4.6378.02 ± 1.7038.67 ± 4.3984.00 ± 4.6192.67 ± 1.79
GLM-4-9b-chat74.26 ± 1.1978.40 ± 1.5517.18 ± 0.5014.48 ± 0.7467.17 ± 4.9377.63 ± 1.7847.67 ± 4.2583.33 ± 4.5199.33 ± 0.46
Qwen2-7B-Instruct75.39 ± 1.1377.68 ± 1.6517.64 ± 0.5613.43 ± 0.767.75 ± 4.4477.95 ± 1.7048.00 ± 4.6683.33 ± 4.4899.00 ± 0.56
Mistral-Nemo-Instruct-240774.12 ± 1.1777.04 ± 1.4817.00 ± 0.4313.50 ± 0.6767.00 ± 4.3077.53 ± 1.6153.67 ± 4.6682.67 ± 4.7774.33 ± 3.77
Mistral-Nemo-BD-RP74.58 ± 1.2878.47 ± 1.4516.62 ± 0.4811.38 ± 0.67*69.08 ± 4.4678.83 ± 1.6759.00 ± 4.4687.00 ± 4.7392.67 ± 1.59

Citation 📖

Please cite our work if you found the resources in this repository useful:

@article{yu2024beyond,
  title   = {BEYOND DIALOGUE: A Profile-Dialogue Alignment Framework Towards General Role-Playing Language Model},
  author  = {Yu, Yeyong and Yu, Runsheng and Wei, Haojie and Zhang, Zhanqiu and Qian, Quan},
  year    = {2024},
  journal = {arXiv preprint arXiv:2408.10903},
}

Acknowledgements 🥰

We would like to express our sincere gratitude to Tencent LightSpeed Studios for their invaluable support in this project. Their contributions and encouragement have been instrumental in the successful completion of our work.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей