Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch
Paper • 2311.03099 • Published • 36
How to use Lambent/CosmoAlpacaLisa-0.3-1b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Lambent/CosmoAlpacaLisa-0.3-1b") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Lambent/CosmoAlpacaLisa-0.3-1b")
model = AutoModelForCausalLM.from_pretrained("Lambent/CosmoAlpacaLisa-0.3-1b", device_map="auto")How to use Lambent/CosmoAlpacaLisa-0.3-1b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Lambent/CosmoAlpacaLisa-0.3-1b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Lambent/CosmoAlpacaLisa-0.3-1b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Lambent/CosmoAlpacaLisa-0.3-1b
How to use Lambent/CosmoAlpacaLisa-0.3-1b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Lambent/CosmoAlpacaLisa-0.3-1b" \
--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": "Lambent/CosmoAlpacaLisa-0.3-1b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Lambent/CosmoAlpacaLisa-0.3-1b" \
--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": "Lambent/CosmoAlpacaLisa-0.3-1b",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Lambent/CosmoAlpacaLisa-0.3-1b with Docker Model Runner:
docker model run hf.co/Lambent/CosmoAlpacaLisa-0.3-1b
Figured the model must have learned the data a somewhat different way for all three training methods. Decided to test if merging them would give generalization benefits. I think it didn't hurt at least!
| Model | AGIEval | GPT4All | TruthfulQA | Bigbench | Average |
|---|---|---|---|---|---|
| CosmoAlpacaLisa-0.3-1b | 23.79 | 51.61 | 40.25 | 29.97 | 36.41 |
| Model | AGIEval | GPT4All | TruthfulQA | Bigbench | Average |
|---|---|---|---|---|---|
| CosmoAlpacaLight-1b | 24.28 | 51.31 | 40.33 | 29.47 | 36.35 |
This is a merge of pre-trained language models created using mergekit.
This model was merged using the DARE TIES merge method using HuggingFaceTB/cosmo-1b as a base.
The following models were included in the merge:
The following YAML configuration was used to produce this model:
models:
- model: Lambent/CosmoAlpacaLisa-1b
parameters:
density: 1.0
weight: 1.0
- model: Lambent/CosmoAlpacaLisa-0.2-1b
parameters:
density: 1.0
weight: 1.0
- model: Lambent/CosmoAlpacaLight-1b
parameters:
density: 1.0
weight: 1.0
merge_method: dare_ties
base_model: HuggingFaceTB/cosmo-1b
parameters:
normalize: true
int8_mask: false
dtype: float16