/ Модель

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

Контекст
8 192 токена
Параметры
8 млрд
Размер весов
16,1 ГБ
Лицензия
CC BY-NC 4.0
Архитектура
cohere2 · dense
Библиотека
transformers
Опубликована
13 дек 2024

c4ai-command-r7b-12-2024

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

Многоязычная языковая модель Cohere для диалогов, ответов на вопросы, RAG, вызова инструментов, суммаризации и генерации кода.

94скачиваний за 30 дней3лайкавеса обновлены13 дек 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

C4AI Command R7B 12-2024 — авторегрессионная языковая модель семейства Cohere2, разработанная Cohere и Cohere For AI. В карточке заявлены 7 млрд параметров, а метаданные указывают 8 млрд; модель использует архитектуру Transformer с чередованием слоёв скользящего и глобального внимания. Метаданные указывают контекст 8192 токена, тогда как README заявляет 128K, поэтому фактическую длину контекста следует проверять для используемой конфигурации.

Модель предназначена для диалогов и инструктивных задач: ответов на вопросы, суммаризации, рассуждений, перевода, категоризации и генерации кода. Она обучена для сценариев RAG и использования инструментов, включая многошаговое взаимодействие с ними. Поддерживает текст на 23 языках, среди которых русский и английский; принимает и генерирует только текст.

Весам требуется Transformers с поддержкой этой модели. Лицензия CC-BY-NC-4.0, также необходимо соблюдать политику допустимого использования Cohere AI. README описывает выпуск как исследовательский и приводит оценки на бенчмарках; качество в конкретных задачах следует проверять отдельно.

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

  • ответы на вопросы по найденным документам в RAG-системе
  • многошаговый вызов API и других инструментов
  • суммаризация длинных текстов
  • генерация, объяснение и преобразование кода
  • перевод и категоризация текста
  • создание диалогового чат-бота

Ограничения

README заявляет контекст 128K токенов, тогда как метаданные указывают 8192 токена; сверяйте фактическую конфигурацию. Лицензия CC-BY-NC-4.0 ограничивает коммерческое использование; также действует политика допустимого использования Cohere AI.

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for C4AI Command R7B

Model Summary

C4AI Command R7B is an open weights research release of a 7B billion parameter model with advanced capabilities optimized for a variety of use cases including reasoning, summarization, question answering, and code. The model is trained to perform sophisticated tasks including Retrieval Augmented Generation (RAG) and tool use. The model also has powerful agentic capabilities with the ability to use and combine multiple tools over multiple steps to accomplish more difficult tasks. It obtains top performance on enterprise relevant code use cases. C4AI Command R7B is a multilingual model trained on 23 languages.

Developed by: Cohere and Cohere For AI

Try C4AI Command R7B

You can try out C4AI Command R7B before downloading the weights in our hosted Hugging Face Space.

Usage

Please install transformers from the source repository that includes the necessary changes for this model.

# pip install 'git+https://github.com/huggingface/transformers.git'
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "CohereForAI/c4ai-command-r7b-12-2024"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

# Format message with the c4ai-command-r7b-12-2024 chat template
messages = [{"role": "user", "content": "Hello, how are you?"}]
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")

gen_tokens = model.generate(
    input_ids,
    max_new_tokens=100,
    do_sample=True,
    temperature=0.3,
)

gen_text = tokenizer.decode(gen_tokens[0], skip_special_tokens=True)
print(gen_text)

Model Details

Input: Models input text only.

Output: Models generate text only.

Model Architecture: This is an auto-regressive language model that uses an optimized transformer architecture. After pretraining, this model uses supervised fine-tuning (SFT) and preference training to align model behavior to human preferences for helpfulness and safety. The model features three layers with sliding window attention (window size 4096) and ROPE for efficient local context modeling and relative positional encoding. A fourth layer uses global attention without positional embeddings, enabling unrestricted token interactions across the entire sequence.

Languages covered: The model has been trained on 23 languages: English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Arabic, Chinese, Russian, Polish, Turkish, Vietnamese, Dutch, Czech, Indonesian, Ukrainian, Romanian, Greek, Hindi, Hebrew, and Persian.

Context length: Command R7B supports a context length of 128K.

A well-rounded model

Command R7B excels on standardized and externally verifiable benchmarks such as the HuggingFace Open LLM Leaderboard. Compared to other similarly sized open-weights models, Command R7B ranks first with strong performance across all tasks.

Command R7BGemma 2 IT 9BMinistral 8BLlama 3.1 8B
Average31.428.92228.2
IFEval77.974.458.9678.6
BBH36.142.125.8229.9
MATH hard26.40.26.519.3
GPQA7.714.84.52.4
MUSR11.69.7410.78.41
MMLU-Pro28.53225.530.7

HuggingFace Leaderboard evaluation results. Competitor numbers are taken from the official leaderboard. Command R7B results are calculated by us using the official HuggingFace prompts and evaluation code.

Chat Capabilities:

Command R7B can be configured as both a conversational model and an instruct model. The conversational mode conditions the model on interactive behaviour, meaning it is expected to reply in a conversational fashion, provides introductory statements and follow-up questions, and uses Markdown as well as LaTeX where appropriate. It is optimized for interactive experiences, such as chatbots, where the model engages in dialogue.

The instruct mode, in contrast, conditions the model to provide concise yet comprehensive responses, and does not use Markdown / LaTeX by default. It is designed for non-interactive, task-focused use cases like extracting information, summarizing text, translation, and categorization.

Note: by default, Command R7B is delivered without a system preamble. We recommend to add the conversational or instruct preambles as described in our docs.

RAG Capabilities:

Command R7B has been trained specifically for tasks like the final step of Retrieval Augmented Generation (RAG).

RAG with Command R7B is supported through chat templates in Transformers. The model takes a conversation as input (with an optional user-supplied system preamble), along with a list of document snippets.

# Define conversation input
conversation = [{"role": "user", "content": "What has Man always dreamed of?"}]

# Define documents for retrieval-based generation
documents = [
  {"heading": "The Moon: Our Age-Old Foe", "body": "Man has always dreamed of destroying the moon. In this essay, I shall..."},
  {"heading": "Love is all you need", "body": "Man's dream has always been to find love. This profound lesson..."}
]

# Get the RAG prompt
input_prompt = tokenizer.apply_chat_template(conversation=conversation, documents=documents, tokenize=False, add_generation_prompt=True, return_tensors="pt")
# Tokenize the prompt
input_ids = tokenizer.encode_plus(input_prompt, return_tensors="pt")

You can then generate text from this input as normal.

Document snippets should be short chunks, rather than long documents, typically around 100-400 words per chunk, formatted as key-value pairs. The keys should be short descriptive strings, the values can be text or semi-structured.

You may find that simply including relevant documents directly in a user message works just as well, or better than using the documents parameter to render the special RAG template. The RAG template is generally a strong default. We encourage users to play with both, and to evaluate which mode works best for their specific use case.

Note that this was a very brief introduction to RAG - for more information, see the Command R7B prompt format docs and the Transformers RAG documentation.

Tool Use Capabilities:

Command R7B has been specifically trained with conversational tool use capabilities. This allows the model to interact with external tools like APIs, databases, or search engines. Instructions on how to leverage these capabilities in Hugging Face are coming soon.

Code Capabilities:

Command R7B has meaningfully improved on code capabilities. In addition to academic code benchmarks, we have evaluated it on enterprise-relevant scenarios, including SQL and code translation, where it outperforms other models of similar size. Try these out by requesting code snippets, code explanations, or code rewrites. For better performance, we also recommend using a low temperature (and even greedy decoding) for code-generation related instructions.

Model Card Contact

For errors or additional questions about details in this model card, contact info@for.ai.

Terms of Use:

We hope that the release of this model will make community-based research efforts more accessible, by releasing the weights of a highly performant 7 billion parameter model to researchers all over the world. This model is governed by a CC-BY-NC License with an acceptable use addendum, and also requires adhering to C4AI's Acceptable Use Policy.

Try Chat:

You can try Command R7B chat in the playground here. You can also use it in our dedicated Hugging Face Space here.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей