Instructions to use Jiaao/aya-expanse-32b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jiaao/aya-expanse-32b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jiaao/aya-expanse-32b")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Jiaao/aya-expanse-32b", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jiaao/aya-expanse-32b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jiaao/aya-expanse-32b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jiaao/aya-expanse-32b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Jiaao/aya-expanse-32b
- SGLang
How to use Jiaao/aya-expanse-32b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Jiaao/aya-expanse-32b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jiaao/aya-expanse-32b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Jiaao/aya-expanse-32b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jiaao/aya-expanse-32b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Jiaao/aya-expanse-32b with Docker Model Runner:
docker model run hf.co/Jiaao/aya-expanse-32b
Aya Expanse 32B
Description
Aya Expanse 32B is a state-of-the-art text generation model developed by Cohere Labs. This model represents a significant advancement in multilingual language understanding and generation capabilities. Built on the foundation of extensive training data and advanced architecture, Aya Expanse 32B delivers exceptional performance across a wide range of natural language processing tasks.
The model features 32 billion parameters and has been optimized for both efficiency and quality in text generation. It excels at understanding context, maintaining coherence over long passages, and generating human-like responses across diverse topics and domains.
Intended use
This model is designed for:
Text Generation: Generating coherent and contextually appropriate text for various applications including creative writing, content creation, and conversational AI.
Language Understanding: Processing and understanding natural language inputs for tasks such as summarization, question answering, and information extraction.
Multilingual Applications: Supporting multiple languages for global deployment and cross-lingual tasks.
Research and Development: Serving as a foundation model for further research in natural language processing and machine learning.
Out of scope uses:
- Generating harmful, misleading, or malicious content
- Automated decision-making in critical domains without human oversight
- Impersonating specific individuals without consent
Limitations
While Aya Expanse 32B is a powerful language model, users should be aware of the following limitations:
Knowledge Cutoff: The model's knowledge is limited to its training data cutoff date and may not reflect recent events or developments.
Hallucination: Like all large language models, Aya Expanse may occasionally generate factually incorrect or fabricated information.
Bias: The model may reflect biases present in its training data. Users should evaluate outputs for potential biases in their specific use case.
Context Length: The model has a maximum context window that limits the amount of text it can process in a single inference.
Domain Specificity: While the model performs well across general domains, it may require fine-tuning for highly specialized technical or professional applications.
Language Coverage: While multilingual, performance may vary across different languages, with English typically showing the strongest results.
How to use
Using Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load model and tokenizer
model_name = "CohereLabs/aya-expanse-32b"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Generate text
prompt = "Once upon a time"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Using the Cohere API
import cohere
co = cohere.Client('YOUR_API_KEY')
response = co.generate(
model='aya-expanse-32b',
prompt='Write a story about a brave explorer',
max_tokens=200
)
print(response.generations[0].text)
Using Hugging Face Pipeline
from transformers import pipeline
generator = pipeline("text-generation", model="CohereLabs/aya-expanse-32b")
result = generator("The future of AI is", max_new_tokens=50)
print(result[0]['generated_text'])
Model Details
- Model Type: Causal Language Model
- Parameters: 32 Billion
- Architecture: Transformer Decoder
- Training Data: Multilingual corpus
- License: Apache 2.0
Citation
If you use this model in your research, please cite:
@model{aya-expanse-32b,
title = {Aya Expanse 32B},
author = {Cohere Labs},
year = {2024},
url = {https://huggingface.co/CohereLabs/aya-expanse-32b}
}