ColdBrew-Indium / README.md
Theros's picture
Upload folder using huggingface_hub
16fe11e verified
metadata
base_model:
  - SvalTek/ColdBrew-Aphid
  - SvalTek/ColdBrew-Aphid
  - SvalTek/ColdBrew-Aphid
  - SvalTek/ColdBrew-Aphid
  - SvalTek/ColdBrew-Aphid
  - SvalTek/ColdBrew-Aphid
tags:
  - merge
  - mergekit
  - lazymergekit
  - SvalTek/ColdBrew-Aphid

ColdBrew-Indium

ColdBrew-Indium is a merge of the following models using LazyMergekit:

🧩 Configuration

const_tag: &scale_factor 0.7071067812  # 1/sqrt(2) scaling for stability

attenuate-env: &attenuated_env
  parameters:
    scale:
      - filter: q_proj
        value: *scale_factor
      - filter: k_proj
        value: *scale_factor
      - filter: v_proj
        value: *scale_factor
      - filter: o_proj
        value: *scale_factor
      - value: 1.0

slices:
  # Preserve input layers
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [0, 8]

  # expand upper layers
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [8, 16]
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [8, 16]
        <<: *attenuated_env

  # expand upper layers
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [16, 22]
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [16, 22]
        <<: *attenuated_env

  # Preserve output layers
  - sources:
      - model: SvalTek/ColdBrew-Aphid
        layer_range: [22, 27]

merge_method: passthrough
dtype: bfloat16

💻 Usage

!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "SvalTek/ColdBrew-Indium"
messages = [{"role": "user", "content": "What is a large language model?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])