Instructions to use catallama/CataLlama-v0.2-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use catallama/CataLlama-v0.2-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="catallama/CataLlama-v0.2-Base") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("catallama/CataLlama-v0.2-Base") model = AutoModelForCausalLM.from_pretrained("catallama/CataLlama-v0.2-Base") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use catallama/CataLlama-v0.2-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "catallama/CataLlama-v0.2-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "catallama/CataLlama-v0.2-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/catallama/CataLlama-v0.2-Base
- SGLang
How to use catallama/CataLlama-v0.2-Base 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 "catallama/CataLlama-v0.2-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "catallama/CataLlama-v0.2-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "catallama/CataLlama-v0.2-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "catallama/CataLlama-v0.2-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use catallama/CataLlama-v0.2-Base with Docker Model Runner:
docker model run hf.co/catallama/CataLlama-v0.2-Base
Model Details
CataLlama-v0.2-Base is a merge between meta-llama/Meta-Llama-3-8B-Instruct and catallama/CataLlama-v0.1-Base
The resulting model retained the Catalan language skills of CataLlama-v0.1-Base, while acquiring basic skills in instruction following.
This is a base model and it is not fine-tuned for downstream tasks although it has acquired some instruction following skills after the merge.
Model developers Laurentiu Petrea.
Model Architecture CataLlama is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and direct preference optimisation (DPO) to align with human preferences for helpfulness and safety.
License The model uses the llama-3 license available at: https://llama.meta.com/llama3/license
Use with transformers
See the snippet below for usage with Transformers:
import transformers
import torch
model_id = "catallama/CataLlama-v0.2-Base"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
outputs = pipeline("Ei com estàs avui?")
print(outputs[0]["generated_text"][len(prompt):])
Merging procedure
The merge was performed only between the 32 layers of the two models, excluding the embedding, norm and the head layers.
The weights of the 32 layers were merged in a 2/3 proportion of CataLlama-v0.1-Base and 1/3 proportion of Meta-Llama-3-8B-Instruct.
The embedding, norm and head layers are copied from Meta-Llama-3-8B-Instruct without modification.
This was done with a custom script, without mergekit.
Intended Use
Note: This model is not intended to beat benchmarks, but to demonstrate techniques for augmenting LLMs on new languages and preserve rare languages as part of our world heritage.
Intended Use Cases Llama 3 is intended for commercial and research use in English. Instruction tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
Out-of-scope Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Llama 3 Community License. Use in languages other than English**.
**Note: Developers may fine-tune Llama 3 models for languages beyond English provided they comply with the Llama 3 Community License and the Acceptable Use Policy.
- Downloads last month
- 3
Model tree for catallama/CataLlama-v0.2-Base
Base model
meta-llama/Meta-Llama-3-8B