Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen2.5-7B
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
tags:
|
| 7 |
+
- not-for-all-audiences
|
| 8 |
+
language:
|
| 9 |
+
- en
|
| 10 |
+
library_name: transformers
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
## Model Description
|
| 14 |
+
|
| 15 |
+
Model created by analyzing and selecting the optimal layers from other Qwen2.5-7B models based on their dimensional utilization efficiency, measured by the Normalized Effective Rank (NER). Computed like:
|
| 16 |
+
|
| 17 |
+
Singular Value Decomposition:
|
| 18 |
+
- Input: Weight matrix A ∈ R^(m×n) # m = number of output features, n = number of input features
|
| 19 |
+
- Compute singular values σᵢ where σᵢ ≥ 0 # σᵢ represents the importance of each dimension
|
| 20 |
+
- Filter values above numerical threshold (>1e-12) # removes numerical noise from computation
|
| 21 |
+
|
| 22 |
+
Distribution Normalization:
|
| 23 |
+
- Sum all singular values: S = Σσᵢ # S acts as normalization factor
|
| 24 |
+
- Create probability distribution: pᵢ = σᵢ/S # converts singular values to probabilities summing to 1
|
| 25 |
+
|
| 26 |
+
Entropy Calculation:
|
| 27 |
+
- Compute Shannon entropy: H = -Σ(pᵢ * log₂(pᵢ)) # measures information content of distribution
|
| 28 |
+
- Calculate maximum possible entropy: H_max = log₂(n) # n = number of singular values
|
| 29 |
+
where n is the number of singular values # maximum entropy occurs when all dimensions contribute equally
|
| 30 |
+
|
| 31 |
+
Normalization:
|
| 32 |
+
- Final NER score = H/H_max # normalizes score to [0,1] range
|
| 33 |
+
- Results in value between 0 and 1 # 0 = single dimension dominance, 1 = perfect dimensional utilization
|
| 34 |
+
- Higher scores indicate more uniform dimensional utilization
|
| 35 |
+
|
| 36 |
+
## Creating Composite Model
|
| 37 |
+
|
| 38 |
+
Code here: https://huggingface.co/jeffmeloy/Qwen2.5-7B-nerd-uncensored-v1.0/blob/main/ner_merge.py
|
| 39 |
+
|
| 40 |
+
Layer Analysis:
|
| 41 |
+
- Download base and fine-tuned models from Hugging Face Hub
|
| 42 |
+
- Calculate Normalized Effective Rank (NER) for each layer within each model
|
| 43 |
+
|
| 44 |
+
Layer Selection:
|
| 45 |
+
- Identify common layer structures across models
|
| 46 |
+
- Define model and layer name pairs that have highest NER for each layer based on their NER scores
|
| 47 |
+
|
| 48 |
+
Model Composition:
|
| 49 |
+
- Incrementally build a composite model using layer with highest NER from model pool.
|
| 50 |
+
|
| 51 |
+
Output Generation:
|
| 52 |
+
- Save merge reports documenting layer sources
|
| 53 |
+
- Copy config and tokenizer files from base model
|
| 54 |
+
- Save the composite model with complete weights # model ready to use
|
| 55 |
+
|
| 56 |
+
Configfile:
|
| 57 |
+
|
| 58 |
+
base_model: "Qwen/Qwen2.5-7B"
|
| 59 |
+
|
| 60 |
+
fine_tuned_models: # uncomment the models you want to merge
|
| 61 |
+
|
| 62 |
+
#- "Qwen/Qwen2.5-7B"
|
| 63 |
+
|
| 64 |
+
#- "Qwen/Qwen2.5-7B-Instruct"
|
| 65 |
+
|
| 66 |
+
#- "FourOhFour/Vapor_v2_7B"
|
| 67 |
+
|
| 68 |
+
#- "Goekdeniz-Guelmez/Josiefied-Qwen2.5-7B-Instruct-abliterated-v2"
|
| 69 |
+
|
| 70 |
+
#- "happzy2633/qwen2.5-7b-ins-v3"
|
| 71 |
+
|
| 72 |
+
#- "huihui-ai/Qwen2.5-7B-Instruct-abliterated-v2"
|
| 73 |
+
|
| 74 |
+
#- "HumanLLMs/Humanish-Qwen2.5-7B-Instruct"
|
| 75 |
+
|
| 76 |
+
#- "Orion-zhen/Qwen2.5-7B-Instruct-Uncensored"
|
| 77 |
+
|
| 78 |
+
#- "Orion-zhen/Meissa-Qwen2.5-7B-Instruct"
|
| 79 |
+
|
| 80 |
+
#- "jeffmeloy/Qwen2.5-7B-nerd-uncensored-v1.0"
|
| 81 |
+
|
| 82 |
+
#- "rombodawg/Rombos-LLM-V2.5-Qwen-7b"
|
| 83 |
+
|
| 84 |
+
#- "Cran-May/T.E-8.1"
|
| 85 |
+
|
| 86 |
+
#- "thomas-yanxin/XinYuan-Qwen2.5-7B-0917"
|
| 87 |
+
|
| 88 |
+
#- "beomi/Qwen2.5-7B-Instruct-kowiki-qa"
|
| 89 |
+
|
| 90 |
+
#- "Orion-zhen/Qwen2.5-7B-Gutenberg-KTO"
|
| 91 |
+
|
| 92 |
+
#- 'fblgit/cybertron-v4-qw7B-MGS'
|
| 93 |
+
|
| 94 |
+
#- 'nguyentd/FinancialAdvice-Qwen2.5-7B'
|
| 95 |
+
|
| 96 |
+
#- "Qwen/Qwen2.5-Coder-7B-Instruct"
|
| 97 |
+
|
| 98 |
+
#- "Qwen/Qwen2.5-Math-7B-Instruct"
|
| 99 |
+
|
| 100 |
+
#- "Qwen/Qwen2.5-Coder-7B"
|
| 101 |
+
|
| 102 |
+
#- "Qwen/Qwen2.5-Math-7B"
|
| 103 |
+
|
| 104 |
+
#- "WhiteRabbitNeo/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B"
|
| 105 |
+
|
| 106 |
+
#- "edgerunner-ai/EdgeRunner-Command-Nested"
|
| 107 |
+
|
| 108 |
+
#- "katanemo/Arch-Function-7B"
|
| 109 |
+
|
| 110 |
+
models_dir: "./input_models/"
|
| 111 |
+
|
| 112 |
+
output_dir: "./merged_model/"
|
| 113 |
+
|
| 114 |
+
metric_dir: "./metrics/"
|