Cohere’s Open Source 35B Model Surpasses Mixtral in RAG and Tool Capabilities

https://txt.cohere.com/command-r/
https://huggingface.co/CohereForAI/c4ai-command-r-v01

1. RAG Performance

On multiple datasets, it far exceeds the Mixtral MoE model. By using their own embeddings and reranking, it significantly outperforms open-source models.Cohere's Open Source 35B Model Surpasses Mixtral in RAG and Tool Capabilities

2. Tool Capabilities

The tool capabilities are slightly better than Mixtral and significantly outperform GPT-3.5.Cohere's Open Source 35B Model Surpasses Mixtral in RAG and Tool Capabilities

3. Multilingual Capabilities

Supports English, French, Spanish, Italian, German, Brazilian Portuguese, Japanese, Korean, Simplified Chinese, and Arabic.Cohere's Open Source 35B Model Surpasses Mixtral in RAG and Tool Capabilities

4. Long Text Capability

The needle-in-a-haystack test can achieve fully green results.

Cohere's Open Source 35B Model Surpasses Mixtral in RAG and Tool Capabilities

5. License

CC-BY-NC, non-commercial use only.

Additional Information

from transformers import AutoTokenizer

model_id = "CohereForAI/c4ai-command-r-v01"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)

# define conversation input:
conversation = [
    {"role": "user", "content": "Whats the biggest penguin in the world?"}
]
# Define tools available for the model to use:
tools = [
  {
    "name": "internet_search",
    "description": "Returns a list of relevant document snippets for a textual query retrieved from the internet",
    "parameter_definitions": {
      "query": {
        "description": "Query to search the internet with",
        "type": 'str',
        "required": True
      }
    }
  },
  {
    'name': "directly_answer",
    "description": "Calls a standard (un-augmented) AI chatbot to generate a response given the conversation history",
    'parameter_definitions': {}
  }
]

# render the tool use prompt as a string:
tool_use_prompt = tokenizer.apply_tool_use_template(
    conversation,
    tools=tools,
    tokenize=False,
    add_generation_prompt=True,
)
print(tool_use_prompt)

Leave a Comment