/ Модель

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

Контекст
32 768 токенов
Параметры
7,1 млрд
Размер весов
93,4 ГБ
Лицензия
Apache 2.0
Архитектура
mixtral · MoE
Базовая модель
Swallow-MX-8x7b-NVE-v0.1
Библиотека
transformers
Опубликована
17 июн 2024

karakuri-lm-8x7b-instruct-v0.1

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

Японско-английская диалоговая MoE-модель для генерации ответов, работы с RAG и вызова инструментов.

90скачиваний за 30 дней19лайковвеса обновлены19 июн 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Модель KARAKURI Inc. karakuri-lm-8x7b-instruct-v0.1 — диалоговая языковая модель на архитектуре Mixtral Mixture of Experts, дообученная на базе tokyotech-llm/Swallow-MX-8x7b-NVE-v0.1. Она предназначена для генерации ответов и инструкций на английском и японском языках, включая сценарии вызова инструментов и работы с RAG. Модель содержит 7,1 млрд параметров и поддерживает контекст до 32 768 токенов.

В шаблоне диалога предусмотрены девять управляемых атрибутов ответа: полезность, корректность, связность, сложность, многословность, качество, токсичность, юмор и креативность. Модель дообучали примерно на 1 млрд токенов данных, в том числе на наборах для диалогов, программирования, вызова функций, математики, SQL и RAG. Репозиторий использует формат safetensors и библиотеку Transformers.

Известное ограничение: модель может пытаться вызывать инструменты, которые не предоставлены приложением; такие вызовы следует отфильтровывать при постобработке. Лицензия — Apache 2.0.

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

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

Ограничения

Модель иногда пытается вызвать инструменты, которые приложению не предоставлены; такие вызовы рекомендуется удалять при постобработке.

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

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

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

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

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

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

Открыть на Hugging Face

KARAKURI LM 8x7B Instruct v0.1

KARAKURI LM

Model Details

Model Description

Usage

Prompt Template

The model uses the same prompt template as Command R+, except that it contains attribute values.

Chat

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("karakuri-ai/karakuri-lm-8x7b-instruct-v0.1")

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"},
    {"role": "assistant", "content": "Hello! How can I help you today?"},
    {"role": "user", "content": "I'm planning a day trip to Tokyo this weekend. Can you recommend a quick sightseeing plan?"}
]
tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)

Tool Use

messages = [
    {"role": "user", "content": "I'm planning a day trip to Tokyo this weekend. Can you recommend a quick sightseeing plan?"}
]
tools = [
    {
        "name": "internet_search",
        "description": "Returns a list of relevant document snippets for a textual query retrieved from the internet",
        "parameters": {
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Query to search the internet with"
                }
            },
            "required": ["query"]
        }
    },
    {
        "name": "directly_answer",
        "description": "Calls a standard (un-augmented) AI chatbot to generate a response given the conversation history",
        "parameters": {
            "type": "object",
            "properties": {}
        }
    }
]
tokenizer.apply_chat_template(
    messages,
    chat_template="tool_use",
    tools=tools,
    add_generation_prompt=True,
    tokenize=False,
)

RAG

messages = [
    {"role": "user", "content": "I'm planning a day trip to Tokyo this weekend. Can you recommend a quick sightseeing plan?"}
]
documents = [
    {
        "title": "Tsukiji Outer Market",
        "text": "While the inner wholesale market has moved to Toyosu, Tsukiji Outer Market remains a bustling hub for fresh seafood and street food. Enjoy sushi, sashimi, and other delicacies while exploring the vibrant market streets.",
    },
    {
        "title": "Meiji Shrine",
        "text": "Nestled in a lush forest in the heart of the city, Meiji Shrine offers a peaceful retreat from the urban hustle. Dedicated to Emperor Meiji and Empress Shoken, the shrine is a popular site for traditional Japanese weddings. Stroll along the serene paths and experience a moment of tranquility."
    }
]
tokenizer.apply_chat_template(
    messages,
    chat_template="rag",
    documents=documents,
    add_generation_prompt=True,
    tokenize=False,
)

Attribute Values

The prompt template contains nine attributes. The first five are derived from HelpSteer, while the remaining four are derived from OASST2. The values are represented by integers ranging from 0 to 4, with 0 being the lowest and 4 being the highest.

  • helpfulness (default: 4): Overall helpfulness of the response to the prompt.
  • correctness (default: 4): Inclusion of all pertinent facts without errors.
  • coherence (default: 4): Consistency and clarity of expression.
  • complexity (default: 4): Intellectual depth required to write response (i.e. whether the response can be written by anyone with basic language competency or requires deep domain expertise).
  • verbosity (default: 4): Amount of detail included in the response, relative to what is asked for in the prompt.
  • quality (default: 4): Perceived goodness of response.
  • toxicity (default: 0): Undesirable elements such as vulgar, harmful or potentially biased response.
  • humor (default: 0): Sense of humor within response.
  • creativity (default: 0): Willingness to generate non-conventional response.

If you want to change the attribute values from the default values specified in the template, you can pass them as arguments to the apply_chat_template method as follows:

messages = [
    {"role": "user", "content": "I'm planning a day trip to Tokyo this weekend. Can you recommend a quick sightseeing plan?"}
]
tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=False,
    helpfulness=0,
    correctness=0,
    coherence=2,
    complexity=0,
    verbosity=3,
    quality=0,
    toxicity=4,
    humor=1,
    creativity=1,
)

Run the model

from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(
    "karakuri-ai/karakuri-lm-8x7b-instruct-v0.1",
    torch_dtype="auto",
    device_map="auto",
)

messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "I'm planning a day trip to Tokyo this weekend. Can you recommend a quick sightseeing plan?"}
]

input_ids = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
).to(model.device)
outputs = model.generate(input_ids, max_new_tokens=512)
tokenizer.decode(outputs[0][input_ids.shape[-1]:])

Training Details

Training Data

The model was trained on approximately 1 billion tokens of fine-tuning data. The details are as follows:

Dataset# Tokens / Epoch# Epochs# TokensPercent
databricks/databricks-dolly-15k3M516M1.5%
glaiveai/glaive-code-assistant-v3520M0.3156M14.6%
glaiveai/glaive-function-calling-v252M3157M14.7%
gretelai/synthetic_text_to_sql19M357M5.3%
meta-math/MetaMathQA81M181M7.6%
microsoft/orca-math-word-problems-200k67M167M6.3%
neural-bridge/rag-dataset-1200012M561M5.7%
neural-bridge/rag-hallucination-dataset-10001M55M0.5%
nvidia/HelpSteer24M5118M11.0%
OpenAssistant/oasst227M5133M12.4%
KARAKURI Instruction Dataset1M56M0.6%
KARAKURI Corpus214M1214M20.0%

Training Infrastructure

  • Hardware: The model was trained on 8 nodes of an Amazon EC2 trn1.32xlarge instance.
  • Software: We use code based on neuronx-nemo-megatron.

Known Limitations

The model sometimes attempts to call unprovided tools. You should implement a post-process to exclude those tools.

Citation

@misc{karakuri_lm_8x7b_instruct_v01,
	author       = { {KARAKURI} {I}nc. },
	title        = { {KARAKURI} {LM} 8x7{B} {I}nstruct v0.1 },
	year         = { 2024 },
	url          = { https://huggingface.co/karakuri-ai/karakuri-lm-8x7b-instruct-v0.1 },
	publisher    = { Hugging Face },
    journal      = { Hugging Face repository }
}

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

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

GPU в ailist

vLLM

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

Подбираем GPU…

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

0 моделей