Commit
•
2f89eea
1
Parent(s):
cc1f610
Upload folder using huggingface_hub
Browse files- README.md +67 -0
- config.json +36 -0
- mergekit_config.yml +21 -0
- model-00001-of-00001.safetensors +3 -0
- model.safetensors.index.json +1 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +64 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- merge
|
4 |
+
- mergekit
|
5 |
+
- lazymergekit
|
6 |
+
- CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
7 |
+
- CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr
|
8 |
+
base_model:
|
9 |
+
- CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
10 |
+
- CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr
|
11 |
+
---
|
12 |
+
|
13 |
+
# Cam_DistilCamembert_FR_SLERP
|
14 |
+
|
15 |
+
Cam_DistilCamembert_FR_SLERP is a merge of the following models using [LazyMergekit](https://colab.research.google.com/drive/1obulZ1ROXHjYLn6PPZJwRR6GzgQogxxb?usp=sharing):
|
16 |
+
* [CGCTG/camembert-base_jina-embeddings-v2-small-en_fr](https://huggingface.co/CGCTG/camembert-base_jina-embeddings-v2-small-en_fr)
|
17 |
+
* [CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr](https://huggingface.co/CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr)
|
18 |
+
|
19 |
+
## 🧩 Configuration
|
20 |
+
|
21 |
+
```yaml
|
22 |
+
slices:
|
23 |
+
- sources:
|
24 |
+
- model: CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
25 |
+
layer_range: [0, 4]
|
26 |
+
- model: CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr
|
27 |
+
layer_range: [0, 4]
|
28 |
+
# or, the equivalent models: syntax:
|
29 |
+
#models:
|
30 |
+
# - model: ClassCat/gpt2-base-french
|
31 |
+
# - model: cmarkea/distilcamembert-base
|
32 |
+
merge_method: slerp
|
33 |
+
base_model: CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
34 |
+
parameters:
|
35 |
+
t:
|
36 |
+
- filter: self_attn
|
37 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
38 |
+
- filter: mlp
|
39 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
40 |
+
- value: 0.5 # fallback for rest of tensors
|
41 |
+
dtype: float16
|
42 |
+
```
|
43 |
+
|
44 |
+
## 💻 Usage
|
45 |
+
|
46 |
+
```python
|
47 |
+
!pip install -qU transformers accelerate
|
48 |
+
|
49 |
+
from transformers import AutoTokenizer
|
50 |
+
import transformers
|
51 |
+
import torch
|
52 |
+
|
53 |
+
model = "CGCTG/Cam_DistilCamembert_FR_SLERP"
|
54 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
55 |
+
|
56 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
57 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
58 |
+
pipeline = transformers.pipeline(
|
59 |
+
"text-generation",
|
60 |
+
model=model,
|
61 |
+
torch_dtype=torch.float16,
|
62 |
+
device_map="auto",
|
63 |
+
)
|
64 |
+
|
65 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
66 |
+
print(outputs[0]["generated_text"])
|
67 |
+
```
|
config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "CGCTG/camembert-base_jina-embeddings-v2-small-en_fr",
|
3 |
+
"architectures": [
|
4 |
+
"BertModel"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.0,
|
7 |
+
"attn_implementation": null,
|
8 |
+
"auto_map": {
|
9 |
+
"AutoConfig": "jinaai/jina-bert-implementation--configuration_bert.JinaBertConfig",
|
10 |
+
"AutoModel": "jinaai/jina-bert-implementation--modeling_bert.JinaBertModel",
|
11 |
+
"AutoModelForMaskedLM": "jinaai/jina-bert-implementation--modeling_bert.JinaBertForMaskedLM",
|
12 |
+
"AutoModelForSequenceClassification": "jinaai/jina-bert-implementation--modeling_bert.JinaBertForSequenceClassification"
|
13 |
+
},
|
14 |
+
"classifier_dropout": null,
|
15 |
+
"emb_pooler": "mean",
|
16 |
+
"feed_forward_type": "geglu",
|
17 |
+
"gradient_checkpointing": false,
|
18 |
+
"hidden_act": "gelu",
|
19 |
+
"hidden_dropout_prob": 0.1,
|
20 |
+
"hidden_size": 512,
|
21 |
+
"initializer_range": 0.02,
|
22 |
+
"intermediate_size": 2048,
|
23 |
+
"layer_norm_eps": 1e-12,
|
24 |
+
"max_position_embeddings": 8192,
|
25 |
+
"model_max_length": 8192,
|
26 |
+
"model_type": "bert",
|
27 |
+
"num_attention_heads": 8,
|
28 |
+
"num_hidden_layers": 4,
|
29 |
+
"pad_token_id": 0,
|
30 |
+
"position_embedding_type": "alibi",
|
31 |
+
"torch_dtype": "float16",
|
32 |
+
"transformers_version": "4.41.0",
|
33 |
+
"type_vocab_size": 2,
|
34 |
+
"use_cache": true,
|
35 |
+
"vocab_size": 30528
|
36 |
+
}
|
mergekit_config.yml
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
slices:
|
3 |
+
- sources:
|
4 |
+
- model: CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
5 |
+
layer_range: [0, 4]
|
6 |
+
- model: CGCTG/distilcamembert-base_jina-embeddings-v2-small-en_fr
|
7 |
+
layer_range: [0, 4]
|
8 |
+
# or, the equivalent models: syntax:
|
9 |
+
#models:
|
10 |
+
# - model: ClassCat/gpt2-base-french
|
11 |
+
# - model: cmarkea/distilcamembert-base
|
12 |
+
merge_method: slerp
|
13 |
+
base_model: CGCTG/camembert-base_jina-embeddings-v2-small-en_fr
|
14 |
+
parameters:
|
15 |
+
t:
|
16 |
+
- filter: self_attn
|
17 |
+
value: [0, 0.5, 0.3, 0.7, 1]
|
18 |
+
- filter: mlp
|
19 |
+
value: [1, 0.5, 0.7, 0.3, 0]
|
20 |
+
- value: 0.5 # fallback for rest of tensors
|
21 |
+
dtype: float16
|
model-00001-of-00001.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1a8cd6b5de4235652e4e8df40f0d584aff58994229d1f8fb60c329081d6ddde7
|
3 |
+
size 65405552
|
model.safetensors.index.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"metadata": {"mergekit_version": "0.0.4.2", "total_size": 65397760}, "weight_map": {"embeddings.LayerNorm.bias": "model-00001-of-00001.safetensors", "embeddings.LayerNorm.weight": "model-00001-of-00001.safetensors", "embeddings.position_embeddings.weight": "model-00001-of-00001.safetensors", "embeddings.token_type_embeddings.weight": "model-00001-of-00001.safetensors", "embeddings.word_embeddings.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.key.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.key.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.query.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.query.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.value.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.attention.self.value.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.intermediate.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.intermediate.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.0.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.0.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.key.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.key.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.query.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.query.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.value.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.attention.self.value.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.intermediate.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.intermediate.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.1.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.1.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.key.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.key.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.query.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.query.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.value.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.attention.self.value.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.intermediate.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.intermediate.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.2.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.2.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.output.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.key.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.key.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.query.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.query.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.value.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.attention.self.value.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.intermediate.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.intermediate.dense.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.output.LayerNorm.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.output.LayerNorm.weight": "model-00001-of-00001.safetensors", "encoder.layer.3.output.dense.bias": "model-00001-of-00001.safetensors", "encoder.layer.3.output.dense.weight": "model-00001-of-00001.safetensors", "pooler.dense.bias": "model-00001-of-00001.safetensors", "pooler.dense.weight": "model-00001-of-00001.safetensors"}}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": {
|
3 |
+
"content": "[CLS]",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"mask_token": {
|
10 |
+
"content": "[MASK]",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": {
|
17 |
+
"content": "[PAD]",
|
18 |
+
"lstrip": false,
|
19 |
+
"normalized": false,
|
20 |
+
"rstrip": false,
|
21 |
+
"single_word": false
|
22 |
+
},
|
23 |
+
"sep_token": {
|
24 |
+
"content": "[SEP]",
|
25 |
+
"lstrip": false,
|
26 |
+
"normalized": false,
|
27 |
+
"rstrip": false,
|
28 |
+
"single_word": false
|
29 |
+
},
|
30 |
+
"unk_token": {
|
31 |
+
"content": "[UNK]",
|
32 |
+
"lstrip": false,
|
33 |
+
"normalized": false,
|
34 |
+
"rstrip": false,
|
35 |
+
"single_word": false
|
36 |
+
}
|
37 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"max_length": 8192,
|
50 |
+
"model_max_length": 2147483648,
|
51 |
+
"never_split": null,
|
52 |
+
"pad_to_multiple_of": null,
|
53 |
+
"pad_token": "[PAD]",
|
54 |
+
"pad_token_type_id": 0,
|
55 |
+
"padding_side": "right",
|
56 |
+
"sep_token": "[SEP]",
|
57 |
+
"stride": 0,
|
58 |
+
"strip_accents": null,
|
59 |
+
"tokenize_chinese_chars": true,
|
60 |
+
"tokenizer_class": "BertTokenizer",
|
61 |
+
"truncation_side": "right",
|
62 |
+
"truncation_strategy": "longest_first",
|
63 |
+
"unk_token": "[UNK]"
|
64 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|