wuji3 commited on
Commit
1e10920
1 Parent(s): 0359966

Feat: upload first model

Browse files
2024-06-07-12-00-09/1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
2024-06-07-12-00-09/README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: []
3
+ library_name: sentence-transformers
4
+ tags:
5
+ - sentence-transformers
6
+ - sentence-similarity
7
+ - feature-extraction
8
+ widget: []
9
+ pipeline_tag: sentence-similarity
10
+ ---
11
+
12
+ # SentenceTransformer
13
+
14
+ This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
15
+
16
+ ## Model Details
17
+
18
+ ### Model Description
19
+ - **Model Type:** Sentence Transformer
20
+ <!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->
21
+ - **Maximum Sequence Length:** 512 tokens
22
+ - **Output Dimensionality:** 1024 tokens
23
+ - **Similarity Function:** Cosine Similarity
24
+ <!-- - **Training Dataset:** Unknown -->
25
+ <!-- - **Language:** Unknown -->
26
+ <!-- - **License:** Unknown -->
27
+
28
+ ### Model Sources
29
+
30
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
31
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
32
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
33
+
34
+ ### Full Model Architecture
35
+
36
+ ```
37
+ SentenceTransformer(
38
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
39
+ (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
40
+ (2): Normalize()
41
+ )
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ ### Direct Usage (Sentence Transformers)
47
+
48
+ First install the Sentence Transformers library:
49
+
50
+ ```bash
51
+ pip install -U sentence-transformers
52
+ ```
53
+
54
+ Then you can load this model and run inference.
55
+ ```python
56
+ from sentence_transformers import SentenceTransformer
57
+
58
+ # Download from the 🤗 Hub
59
+ model = SentenceTransformer("sentence_transformers_model_id")
60
+ # Run inference
61
+ sentences = [
62
+ 'The weather is lovely today.',
63
+ "It's so sunny outside!",
64
+ 'He drove to the stadium.',
65
+ ]
66
+ embeddings = model.encode(sentences)
67
+ print(embeddings.shape)
68
+ # [3, 1024]
69
+
70
+ # Get the similarity scores for the embeddings
71
+ similarities = model.similarity(embeddings, embeddings)
72
+ print(similarities.shape)
73
+ # [3, 3]
74
+ ```
75
+
76
+ <!--
77
+ ### Direct Usage (Transformers)
78
+
79
+ <details><summary>Click to see the direct usage in Transformers</summary>
80
+
81
+ </details>
82
+ -->
83
+
84
+ <!--
85
+ ### Downstream Usage (Sentence Transformers)
86
+
87
+ You can finetune this model on your own dataset.
88
+
89
+ <details><summary>Click to expand</summary>
90
+
91
+ </details>
92
+ -->
93
+
94
+ <!--
95
+ ### Out-of-Scope Use
96
+
97
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
98
+ -->
99
+
100
+ <!--
101
+ ## Bias, Risks and Limitations
102
+
103
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
104
+ -->
105
+
106
+ <!--
107
+ ### Recommendations
108
+
109
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
110
+ -->
111
+
112
+ ## Training Details
113
+
114
+ ### Framework Versions
115
+ - Python: 3.10.14
116
+ - Sentence Transformers: 3.0.0
117
+ - Transformers: 4.41.2
118
+ - PyTorch: 2.3.1+cu121
119
+ - Accelerate: 0.30.1
120
+ - Datasets: 2.19.2
121
+ - Tokenizers: 0.19.1
122
+
123
+ ## Citation
124
+
125
+ ### BibTeX
126
+
127
+ <!--
128
+ ## Glossary
129
+
130
+ *Clearly define terms in order to be accessible across audiences.*
131
+ -->
132
+
133
+ <!--
134
+ ## Model Card Authors
135
+
136
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
137
+ -->
138
+
139
+ <!--
140
+ ## Model Card Contact
141
+
142
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
143
+ -->
2024-06-07-12-00-09/config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/home/duke/shoppal-bge/embedding-sft-output/2024-06-07-12-00-09",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 1024,
12
+ "id2label": {
13
+ "0": "LABEL_0"
14
+ },
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 4096,
17
+ "label2id": {
18
+ "LABEL_0": 0
19
+ },
20
+ "layer_norm_eps": 1e-12,
21
+ "max_position_embeddings": 512,
22
+ "model_type": "bert",
23
+ "num_attention_heads": 16,
24
+ "num_hidden_layers": 24,
25
+ "pad_token_id": 0,
26
+ "position_embedding_type": "absolute",
27
+ "torch_dtype": "float32",
28
+ "transformers_version": "4.41.2",
29
+ "type_vocab_size": 2,
30
+ "use_cache": true,
31
+ "vocab_size": 30522
32
+ }
2024-06-07-12-00-09/config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.0",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.3.1+cu121"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": null
10
+ }
2024-06-07-12-00-09/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e1e812a712fd7129674260051a063185397ffb8f629be46e542d01c64372194
3
+ size 1340612432
2024-06-07-12-00-09/modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
2024-06-07-12-00-09/run_duke_sft.sh ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /bin/bash
2
+
3
+ torchrun --nproc_per_node 8 \
4
+ -m FlagEmbedding.baai_general_embedding.finetune.run \
5
+ --output_dir /home/duke/shoppal-bge/embedding-sft-output \
6
+ --model_name_or_path BAAI/bge-large-en-v1.5 \
7
+ --train_data shoppal/embedding-index \
8
+ --sub_data_name source2.3 \
9
+ --learning_rate 1e-5 \
10
+ --fp16 \
11
+ --num_train_epochs 10 \
12
+ --per_device_train_batch_size 16 \
13
+ --dataloader_drop_last True \
14
+ --normlized True \
15
+ --temperature 0.02 \
16
+ --query_max_len 512 \
17
+ --passage_max_len 512 \
18
+ --train_group_size 5 \
19
+ --negatives_cross_device True \
20
+ --use_inbatch_neg True \
21
+ --logging_steps 10 \
22
+ --save_steps 1000 \
23
+ --query_instruction_for_retrieval ""
2024-06-07-12-00-09/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
2024-06-07-12-00-09/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
+ }
2024-06-07-12-00-09/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
2024-06-07-12-00-09/tokenizer_config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "model_max_length": 512,
50
+ "never_split": null,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "strip_accents": null,
54
+ "tokenize_chinese_chars": true,
55
+ "tokenizer_class": "BertTokenizer",
56
+ "unk_token": "[UNK]"
57
+ }
2024-06-07-12-00-09/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7acbf9371b92c20952611e4a015e220d75ec4f2ddd44037a0ecb062c3f42d5ef
3
+ size 5432
2024-06-07-12-00-09/vocab.txt ADDED
The diff for this file is too large to render. See raw diff