Francogv commited on
Commit
ce3244a
·
verified ·
1 Parent(s): 2760642

Delete modelo_local

Browse files
modelo_local/1_Pooling/config.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "word_embedding_dimension": 768,
3
- "pooling_mode_cls_token": false,
4
- "pooling_mode_mean_tokens": true,
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
- }
 
 
 
 
 
 
 
 
 
 
 
modelo_local/README.md DELETED
@@ -1,184 +0,0 @@
1
- ---
2
- language:
3
- - multilingual
4
- - ar
5
- - bg
6
- - ca
7
- - cs
8
- - da
9
- - de
10
- - el
11
- - en
12
- - es
13
- - et
14
- - fa
15
- - fi
16
- - fr
17
- - gl
18
- - gu
19
- - he
20
- - hi
21
- - hr
22
- - hu
23
- - hy
24
- - id
25
- - it
26
- - ja
27
- - ka
28
- - ko
29
- - ku
30
- - lt
31
- - lv
32
- - mk
33
- - mn
34
- - mr
35
- - ms
36
- - my
37
- - nb
38
- - nl
39
- - pl
40
- - pt
41
- - ro
42
- - ru
43
- - sk
44
- - sl
45
- - sq
46
- - sr
47
- - sv
48
- - th
49
- - tr
50
- - uk
51
- - ur
52
- - vi
53
- license: apache-2.0
54
- library_name: sentence-transformers
55
- tags:
56
- - sentence-transformers
57
- - feature-extraction
58
- - sentence-similarity
59
- - transformers
60
- - text-embeddings-inference
61
- language_bcp47:
62
- - fr-ca
63
- - pt-br
64
- - zh-cn
65
- - zh-tw
66
- pipeline_tag: sentence-similarity
67
- ---
68
-
69
- # sentence-transformers/paraphrase-multilingual-mpnet-base-v2
70
-
71
- This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 768 dimensional dense vector space and can be used for tasks like clustering or semantic search.
72
-
73
-
74
-
75
- ## Usage (Sentence-Transformers)
76
-
77
- Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:
78
-
79
- ```
80
- pip install -U sentence-transformers
81
- ```
82
-
83
- Then you can use the model like this:
84
-
85
- ```python
86
- from sentence_transformers import SentenceTransformer
87
- sentences = ["This is an example sentence", "Each sentence is converted"]
88
-
89
- model = SentenceTransformer('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')
90
- embeddings = model.encode(sentences)
91
- print(embeddings)
92
- ```
93
-
94
-
95
-
96
- ## Usage (HuggingFace Transformers)
97
- Without [sentence-transformers](https://www.SBERT.net), you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings.
98
-
99
- ```python
100
- from transformers import AutoTokenizer, AutoModel
101
- import torch
102
-
103
-
104
- # Mean Pooling - Take attention mask into account for correct averaging
105
- def mean_pooling(model_output, attention_mask):
106
- token_embeddings = model_output[0] # First element of model_output contains all token embeddings
107
- input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
108
- return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
109
-
110
-
111
- # Sentences we want sentence embeddings for
112
- sentences = ['This is an example sentence', 'Each sentence is converted']
113
-
114
- # Load model from HuggingFace Hub
115
- tokenizer = AutoTokenizer.from_pretrained('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')
116
- model = AutoModel.from_pretrained('sentence-transformers/paraphrase-multilingual-mpnet-base-v2')
117
-
118
- # Tokenize sentences
119
- encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
120
-
121
- # Compute token embeddings
122
- with torch.no_grad():
123
- model_output = model(**encoded_input)
124
-
125
- # Perform pooling. In this case, mean pooling
126
- sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
127
-
128
- print("Sentence embeddings:")
129
- print(sentence_embeddings)
130
- ```
131
-
132
-
133
- ## Usage (Text Embeddings Inference (TEI))
134
-
135
- [Text Embeddings Inference (TEI)](https://github.com/huggingface/text-embeddings-inference) is a blazing fast inference solution for text embedding models.
136
-
137
- - CPU:
138
- ```bash
139
- docker run -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16
140
- ```
141
-
142
- - NVIDIA GPU:
143
- ```bash
144
- docker run --gpus all -p 8080:80 -v hf_cache:/data --pull always ghcr.io/huggingface/text-embeddings-inference:cuda-latest --model-id sentence-transformers/paraphrase-multilingual-mpnet-base-v2 --pooling mean --dtype float16
145
- ```
146
-
147
- Send a request to `/v1/embeddings` to generate embeddings via the [OpenAI Embeddings API](https://platform.openai.com/docs/api-reference/embeddings/create):
148
- ```bash
149
- curl http://localhost:8080/v1/embeddings \
150
- -H "Content-Type: application/json" \
151
- -d '{
152
- "model": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
153
- "input": "This is an example sentence"
154
- }'
155
- ```
156
-
157
- Or check the [Text Embeddings Inference API specification](https://huggingface.github.io/text-embeddings-inference/) instead.
158
-
159
-
160
-
161
- ## Full Model Architecture
162
- ```
163
- SentenceTransformer(
164
- (0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
165
- (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False})
166
- )
167
- ```
168
-
169
- ## Citing & Authors
170
-
171
- This model was trained by [sentence-transformers](https://www.sbert.net/).
172
-
173
- If you find this model helpful, feel free to cite our publication [Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks](https://arxiv.org/abs/1908.10084):
174
- ```bibtex
175
- @inproceedings{reimers-2019-sentence-bert,
176
- title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
177
- author = "Reimers, Nils and Gurevych, Iryna",
178
- booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
179
- month = "11",
180
- year = "2019",
181
- publisher = "Association for Computational Linguistics",
182
- url = "http://arxiv.org/abs/1908.10084",
183
- }
184
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modelo_local/config.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "architectures": [
3
- "XLMRobertaModel"
4
- ],
5
- "attention_probs_dropout_prob": 0.1,
6
- "bos_token_id": 0,
7
- "classifier_dropout": null,
8
- "eos_token_id": 2,
9
- "gradient_checkpointing": false,
10
- "hidden_act": "gelu",
11
- "hidden_dropout_prob": 0.1,
12
- "hidden_size": 768,
13
- "initializer_range": 0.02,
14
- "intermediate_size": 3072,
15
- "layer_norm_eps": 1e-05,
16
- "max_position_embeddings": 514,
17
- "model_type": "xlm-roberta",
18
- "num_attention_heads": 12,
19
- "num_hidden_layers": 12,
20
- "output_past": true,
21
- "pad_token_id": 1,
22
- "position_embedding_type": "absolute",
23
- "torch_dtype": "float32",
24
- "transformers_version": "4.55.4",
25
- "type_vocab_size": 1,
26
- "use_cache": true,
27
- "vocab_size": 250002
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modelo_local/config_sentence_transformers.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "__version__": {
3
- "sentence_transformers": "5.1.0",
4
- "transformers": "4.55.4",
5
- "pytorch": "2.8.0+cu126"
6
- },
7
- "model_type": "SentenceTransformer",
8
- "prompts": {
9
- "query": "",
10
- "document": ""
11
- },
12
- "default_prompt_name": null,
13
- "similarity_fn_name": "cosine"
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modelo_local/model.safetensors DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2eb113e32dd129f5fbfd09b1accdb069d27305d7a570a7c60460a750bb53193d
3
- size 1112197096
 
 
 
 
modelo_local/modules.json DELETED
@@ -1,14 +0,0 @@
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
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modelo_local/sentence_bert_config.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "max_seq_length": 128,
3
- "do_lower_case": false
4
- }
 
 
 
 
 
modelo_local/sentencepiece.bpe.model DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
- size 5069051
 
 
 
 
modelo_local/special_tokens_map.json DELETED
@@ -1,51 +0,0 @@
1
- {
2
- "bos_token": {
3
- "content": "<s>",
4
- "lstrip": false,
5
- "normalized": false,
6
- "rstrip": false,
7
- "single_word": false
8
- },
9
- "cls_token": {
10
- "content": "<s>",
11
- "lstrip": false,
12
- "normalized": false,
13
- "rstrip": false,
14
- "single_word": false
15
- },
16
- "eos_token": {
17
- "content": "</s>",
18
- "lstrip": false,
19
- "normalized": false,
20
- "rstrip": false,
21
- "single_word": false
22
- },
23
- "mask_token": {
24
- "content": "<mask>",
25
- "lstrip": true,
26
- "normalized": false,
27
- "rstrip": false,
28
- "single_word": false
29
- },
30
- "pad_token": {
31
- "content": "<pad>",
32
- "lstrip": false,
33
- "normalized": false,
34
- "rstrip": false,
35
- "single_word": false
36
- },
37
- "sep_token": {
38
- "content": "</s>",
39
- "lstrip": false,
40
- "normalized": false,
41
- "rstrip": false,
42
- "single_word": false
43
- },
44
- "unk_token": {
45
- "content": "<unk>",
46
- "lstrip": false,
47
- "normalized": false,
48
- "rstrip": false,
49
- "single_word": false
50
- }
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modelo_local/tokenizer.json DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:cad551d5600a84242d0973327029452a1e3672ba6313c2a3c3d69c4310e12719
3
- size 17082987
 
 
 
 
modelo_local/tokenizer_config.json DELETED
@@ -1,62 +0,0 @@
1
- {
2
- "added_tokens_decoder": {
3
- "0": {
4
- "content": "<s>",
5
- "lstrip": false,
6
- "normalized": false,
7
- "rstrip": false,
8
- "single_word": false,
9
- "special": true
10
- },
11
- "1": {
12
- "content": "<pad>",
13
- "lstrip": false,
14
- "normalized": false,
15
- "rstrip": false,
16
- "single_word": false,
17
- "special": true
18
- },
19
- "2": {
20
- "content": "</s>",
21
- "lstrip": false,
22
- "normalized": false,
23
- "rstrip": false,
24
- "single_word": false,
25
- "special": true
26
- },
27
- "3": {
28
- "content": "<unk>",
29
- "lstrip": false,
30
- "normalized": false,
31
- "rstrip": false,
32
- "single_word": false,
33
- "special": true
34
- },
35
- "250001": {
36
- "content": "<mask>",
37
- "lstrip": true,
38
- "normalized": false,
39
- "rstrip": false,
40
- "single_word": false,
41
- "special": true
42
- }
43
- },
44
- "bos_token": "<s>",
45
- "clean_up_tokenization_spaces": false,
46
- "cls_token": "<s>",
47
- "eos_token": "</s>",
48
- "extra_special_tokens": {},
49
- "mask_token": "<mask>",
50
- "max_length": 128,
51
- "model_max_length": 128,
52
- "pad_to_multiple_of": null,
53
- "pad_token": "<pad>",
54
- "pad_token_type_id": 0,
55
- "padding_side": "right",
56
- "sep_token": "</s>",
57
- "stride": 0,
58
- "tokenizer_class": "XLMRobertaTokenizer",
59
- "truncation_side": "right",
60
- "truncation_strategy": "longest_first",
61
- "unk_token": "<unk>"
62
- }