aya expanse 32b

CohereForAI

Introduction

Aya Expanse 32B is a state-of-the-art, multilingual large language model developed by Cohere For AI. It features advanced capabilities across 23 languages and is designed for diverse text generation tasks. The model represents a culmination of extensive research, including data arbitrage, multilingual preference training, safety tuning, and model merging.

Architecture

Aya Expanse 32B is an auto-regressive language model utilizing an optimized transformer architecture. It supports 23 languages, including English, Chinese, Spanish, and Arabic, among others. The model includes a robust post-training process with supervised fine-tuning and preference training to enhance performance.

Training

The model was developed through significant research efforts, focusing on multilingual capabilities. This included using datasets like the Aya Evaluation Suite and m-ArenaHard to evaluate and enhance performance. The model's training involved comparing its capabilities against other significant models such as Gemma 2 27B and Llama 3.1 70B.

Guide: Running Locally

  1. Install the Transformers Library: Ensure you have the transformers library installed.

    pip install transformers
    
  2. Load the Model: Use the following Python code to load the Aya Expanse 32B model.

    from transformers import AutoTokenizer, AutoModelForCausalLM
    
    model_id = "CohereForAI/aya-expanse-32b"
    tokenizer = AutoTokenizer.from_pretrained(model_id)
    model = AutoModelForCausalLM.from_pretrained(model_id)
    
    messages = [{"role": "user", "content": "Write a letter expressing my love for my mother"}]
    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])
    print(gen_text)
    
  3. Cloud GPUs: For optimal performance, consider using cloud GPU services such as AWS EC2, Google Cloud Platform, or Azure.

License

Aya Expanse 32B is released under the CC-BY-NC license, which allows for non-commercial use. Users must also adhere to C4AI's Acceptable Use Policy. For detailed licensing information, visit the license page.

More Related APIs in Text Generation