Sentence Similarity
sentence-transformers
PyTorch
Rust
Safetensors
Transformers
English
bert
feature-extraction
text-embeddings-inference
Run this model with HF Jobs
Run LogeshLogesh/all-MiniLM-L12-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/LogeshLogesh/all-MiniLM-L12-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/LogeshLogesh/all-MiniLM-L12-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use LogeshLogesh/all-MiniLM-L12-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use LogeshLogesh/all-MiniLM-L12-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("LogeshLogesh/all-MiniLM-L12-v2") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use LogeshLogesh/all-MiniLM-L12-v2 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("LogeshLogesh/all-MiniLM-L12-v2") model = AutoModel.from_pretrained("LogeshLogesh/all-MiniLM-L12-v2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Uploaded an file
Browse filesFiles changed (15)
- .gitattributes+28-35
- README.md+174
- config.jsonAdded+24
- config_sentence_transformers.jsonAdded+7
- data_config.jsonAdded+1452
- model.safetensorsAdded+3
- modules.jsonAdded+20
- pytorch_model.binAdded+3
- rust_model.otAdded+3
- sentence_bert_config.jsonAdded+4
- special_tokens_map.jsonAdded+1
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+1
- train_script.pyAdded+344
- vocab.txtAdded
1234567891011121314151617181920212223242526272829303132333435*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text12345678910111213141516171819202122232425262728*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bin.* filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zstandard filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textmodel.safetensors filter=lfs diff=lfs merge=lfs -text
123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177---language: enlicense: apache-2.0library_name: sentence-transformerstags:- sentence-transformers- feature-extraction- sentence-similarity- transformersdatasets:- s2orc- flax-sentence-embeddings/stackexchange_xml- ms_marco- gooaq- yahoo_answers_topics- code_search_net- search_qa- eli5- snli- multi_nli- wikihow- natural_questions- trivia_qa- embedding-data/sentence-compression- embedding-data/flickr30k-captions- embedding-data/altlex- embedding-data/simple-wiki- embedding-data/QQP- embedding-data/SPECTER- embedding-data/PAQ_pairs- embedding-data/WikiAnswerspipeline_tag: sentence-similarity---# all-MiniLM-L12-v2This is a [sentence-transformers](https://www.SBERT.net) model: It maps sentences & paragraphs to a 384 dimensional dense vector space and can be used for tasks like clustering or semantic search.## Usage (Sentence-Transformers)Using this model becomes easy when you have [sentence-transformers](https://www.SBERT.net) installed:```pip install -U sentence-transformers```Then you can use the model like this:```pythonfrom sentence_transformers import SentenceTransformersentences = ["This is an example sentence", "Each sentence is converted"]model = SentenceTransformer('sentence-transformers/all-MiniLM-L12-v2')embeddings = model.encode(sentences)print(embeddings)```## Usage (HuggingFace Transformers)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.```pythonfrom transformers import AutoTokenizer, AutoModelimport torchimport torch.nn.functional as F#Mean Pooling - Take attention mask into account for correct averagingdef mean_pooling(model_output, attention_mask):token_embeddings = model_output[0] #First element of model_output contains all token embeddingsinput_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)# Sentences we want sentence embeddings forsentences = ['This is an example sentence', 'Each sentence is converted']# Load model from HuggingFace Hubtokenizer = AutoTokenizer.from_pretrained('sentence-transformers/all-MiniLM-L12-v2')model = AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L12-v2')# Tokenize sentencesencoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')# Compute token embeddingswith torch.no_grad():model_output = model(**encoded_input)# Perform poolingsentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])# Normalize embeddingssentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)print("Sentence embeddings:")print(sentence_embeddings)```## Evaluation ResultsFor an automated evaluation of this model, see the *Sentence Embeddings Benchmark*: [https://seb.sbert.net](https://seb.sbert.net?model_name=sentence-transformers/all-MiniLM-L12-v2)------## BackgroundThe project aims to train sentence embedding models on very large sentence level datasets using a self-supervisedcontrastive learning objective. We used the pretrained [`microsoft/MiniLM-L12-H384-uncased`](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) model and fine-tuned in on a1B sentence pairs dataset. We use a contrastive learning objective: given a sentence from the pair, the model should predict which out of a set of randomly sampled other sentences, was actually paired with it in our dataset.We developped this model during the[Community week using JAX/Flax for NLP & CV](https://discuss.huggingface.co/t/open-to-the-community-community-week-using-jax-flax-for-nlp-cv/7104),organized by Hugging Face. We developped this model as part of the project:[Train the Best Sentence Embedding Model Ever with 1B Training Pairs](https://discuss.huggingface.co/t/train-the-best-sentence-embedding-model-ever-with-1b-training-pairs/7354). We benefited from efficient hardware infrastructure to run the project: 7 TPUs v3-8, as well as intervention from Googles Flax, JAX, and Cloud team member about efficient deep learning frameworks.## Intended usesOur model is intented to be used as a sentence and short paragraph encoder. Given an input text, it ouptuts a vector which capturesthe semantic information. The sentence vector may be used for information retrieval, clustering or sentence similarity tasks.By default, input text longer than 256 word pieces is truncated.## Training procedure### Pre-trainingWe use the pretrained [`microsoft/MiniLM-L12-H384-uncased`](https://huggingface.co/microsoft/MiniLM-L12-H384-uncased) model. Please refer to the model card for more detailed information about the pre-training procedure.### Fine-tuningWe fine-tune the model using a contrastive objective. Formally, we compute the cosine similarity from each possible sentence pairs from the batch.We then apply the cross entropy loss by comparing with true pairs.#### Hyper parametersWe trained ou model on a TPU v3-8. We train the model during 100k steps using a batch size of 1024 (128 per TPU core).We use a learning rate warm up of 500. The sequence length was limited to 128 tokens. We used the AdamW optimizer witha 2e-5 learning rate. The full training script is accessible in this current repository: `train_script.py`.#### Training dataWe use the concatenation from multiple datasets to fine-tune our model. The total number of sentence pairs is above 1 billion sentences.We sampled each dataset given a weighted probability which configuration is detailed in the `data_config.json` file.| Dataset | Paper | Number of training tuples ||--------------------------------------------------------|:----------------------------------------:|:--------------------------:|| [Reddit comments (2015-2018)](https://github.com/PolyAI-LDN/conversational-datasets/tree/master/reddit) | [paper](https://arxiv.org/abs/1904.06472) | 726,484,430 || [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Abstracts) | [paper](https://aclanthology.org/2020.acl-main.447/) | 116,288,806 || [WikiAnswers](https://github.com/afader/oqa#wikianswers-corpus) Duplicate question pairs | [paper](https://doi.org/10.1145/2623330.2623677) | 77,427,422 || [PAQ](https://github.com/facebookresearch/PAQ) (Question, Answer) pairs | [paper](https://arxiv.org/abs/2102.07033) | 64,371,441 || [S2ORC](https://github.com/allenai/s2orc) Citation pairs (Titles) | [paper](https://aclanthology.org/2020.acl-main.447/) | 52,603,982 || [S2ORC](https://github.com/allenai/s2orc) (Title, Abstract) | [paper](https://aclanthology.org/2020.acl-main.447/) | 41,769,185 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Body) pairs | - | 25,316,456 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title+Body, Answer) pairs | - | 21,396,559 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) (Title, Answer) pairs | - | 21,396,559 || [MS MARCO](https://microsoft.github.io/msmarco/) triplets | [paper](https://doi.org/10.1145/3404835.3462804) | 9,144,553 || [GOOAQ: Open Question Answering with Diverse Answer Types](https://github.com/allenai/gooaq) | [paper](https://arxiv.org/pdf/2104.08727.pdf) | 3,012,496 || [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 1,198,260 || [Code Search](https://huggingface.co/datasets/code_search_net) | - | 1,151,414 || [COCO](https://cocodataset.org/#home) Image captions | [paper](https://link.springer.com/chapter/10.1007%2F978-3-319-10602-1_48) | 828,395|| [SPECTER](https://github.com/allenai/specter) citation triplets | [paper](https://doi.org/10.18653/v1/2020.acl-main.207) | 684,100 || [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Question, Answer) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 681,164 || [Yahoo Answers](https://www.kaggle.com/soumikrakshit/yahoo-answers-dataset) (Title, Question) | [paper](https://proceedings.neurips.cc/paper/2015/hash/250cf8b51c773f3f8dc8b4be867a9a02-Abstract.html) | 659,896 || [SearchQA](https://huggingface.co/datasets/search_qa) | [paper](https://arxiv.org/abs/1704.05179) | 582,261 || [Eli5](https://huggingface.co/datasets/eli5) | [paper](https://doi.org/10.18653/v1/p19-1346) | 325,475 || [Flickr 30k](https://shannon.cs.illinois.edu/DenotationGraph/) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/229/33) | 317,695 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles) | | 304,525 || AllNLI ([SNLI](https://nlp.stanford.edu/projects/snli/) and [MultiNLI](https://cims.nyu.edu/~sbowman/multinli/) | [paper SNLI](https://doi.org/10.18653/v1/d15-1075), [paper MultiNLI](https://doi.org/10.18653/v1/n18-1101) | 277,230 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (bodies) | | 250,519 || [Stack Exchange](https://huggingface.co/datasets/flax-sentence-embeddings/stackexchange_xml) Duplicate questions (titles+bodies) | | 250,460 || [Sentence Compression](https://github.com/google-research-datasets/sentence-compression) | [paper](https://www.aclweb.org/anthology/D13-1155/) | 180,000 || [Wikihow](https://github.com/pvl/wikihow_pairs_dataset) | [paper](https://arxiv.org/abs/1810.09305) | 128,542 || [Altlex](https://github.com/chridey/altlex/) | [paper](https://aclanthology.org/P16-1135.pdf) | 112,696 || [Quora Question Triplets](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs) | - | 103,663 || [Simple Wikipedia](https://cs.pomona.edu/~dkauchak/simplification/) | [paper](https://www.aclweb.org/anthology/P11-2117/) | 102,225 || [Natural Questions (NQ)](https://ai.google.com/research/NaturalQuestions) | [paper](https://transacl.org/ojs/index.php/tacl/article/view/1455) | 100,231 || [SQuAD2.0](https://rajpurkar.github.io/SQuAD-explorer/) | [paper](https://aclanthology.org/P18-2124.pdf) | 87,599 || [TriviaQA](https://huggingface.co/datasets/trivia_qa) | - | 73,346 || **Total** | | **1,170,060,424** |
123456789101112131415161718192021222324{
"_name_or_path": "microsoft/MiniLM-L12-H384-uncased",
"architectures": [
"BertModel"
],
"attention_probs_dropout_prob": 0.1,
"gradient_checkpointing": false,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 384,
"initializer_range": 0.02,
"intermediate_size": 1536,
"layer_norm_eps": 1e-12,
"max_position_embeddings": 512,
"model_type": "bert",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 0,
"position_embedding_type": "absolute",
"transformers_version": "4.8.2",
"type_vocab_size": 2,
"use_cache": true,
"vocab_size": 30522
}1234567{
"__version__": {
"sentence_transformers": "2.0.0",
"transformers": "4.6.1",
"pytorch": "1.8.1"
}
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452[
{
"name": "stackexchange_title_body/skeptics.stackexchange.com.jsonl.gz",
"lines": 10009,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/islam.stackexchange.com.jsonl.gz",
"lines": 10052,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/islam.stackexchange.com.jsonl.gz",
"lines": 10052,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/anime.stackexchange.com.jsonl.gz",
"lines": 10131,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/anime.stackexchange.com.jsonl.gz",
"lines": 10131,
"weight": 1
},
{
"name": "stackexchange_title_body/writers.stackexchange.com.jsonl.gz",
"lines": 10157,
"weight": 1
},
{
"name": "stackexchange_title_body/astronomy.stackexchange.com.jsonl.gz",
"lines": 10462,
"weight": 1
},
{
"name": "stackexchange_title_body/vi.stackexchange.com.jsonl.gz",
"lines": 10551,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/french.stackexchange.com.jsonl.gz",
"lines": 10578,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/french.stackexchange.com.jsonl.gz",
"lines": 10578,
"weight": 1
},
{
"name": "stackexchange_title_body/cstheory.stackexchange.com.jsonl.gz",
"lines": 10642,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/civicrm.stackexchange.com.jsonl.gz",
"lines": 10648,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/civicrm.stackexchange.com.jsonl.gz",
"lines": 10648,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/expressionengine.stackexchange.com.jsonl.gz",
"lines": 10742,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/expressionengine.stackexchange.com.jsonl.gz",
"lines": 10742,
"weight": 1
},
{
"name": "stackexchange_title_body/engineering.stackexchange.com.jsonl.gz",
"lines": 10753,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/history.stackexchange.com.jsonl.gz",
"lines": 10766,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/history.stackexchange.com.jsonl.gz",
"lines": 10766,
"weight": 1
},
{
"name": "stackexchange_title_body/french.stackexchange.com.jsonl.gz",
"lines": 10794,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/politics.stackexchange.com.jsonl.gz",
"lines": 11047,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/politics.stackexchange.com.jsonl.gz",
"lines": 11047,
"weight": 1
},
{
"name": "stackexchange_title_body/economics.stackexchange.com.jsonl.gz",
"lines": 11115,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/craftcms.stackexchange.com.jsonl.gz",
"lines": 11236,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/craftcms.stackexchange.com.jsonl.gz",
"lines": 11236,
"weight": 1
},
{
"name": "stackexchange_title_body/anime.stackexchange.com.jsonl.gz",
"lines": 11444,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/christianity.stackexchange.com.jsonl.gz",
"lines": 11498,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/christianity.stackexchange.com.jsonl.gz",
"lines": 11498,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/softwarerecs.stackexchange.com.jsonl.gz",
"lines": 11761,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/softwarerecs.stackexchange.com.jsonl.gz",
"lines": 11761,
"weight": 1
},
{
"name": "stackexchange_TitleBody_Answer/boardgames.stackexchange.com.jsonl.gz",
"lines": 11805,
"weight": 1
},
{
"name": "stackexchange_Title_Answer/boardgames.stackexchange.com.jsonl.gz",
"lines": 11805,
"weight": 1
},
{
"name": "stackexchange_title_body/islam.stackexchange.com.jsonl.gz",
"lines": 11853,
"weight": 1
},
{
"name": "stackexchange_title_body/expressionengine.stackexchange.com.jsonl.gz",
"lines": 11866,
"weight": 1
},
{
"name": "stackexchange_title_body/politics.stackexchange.com.jsonl.gz",
"lines": 11894,
"weight": 1
},
{
"name": "stackexchange_title_body/history.stackexchange.com.jsonl.gz",
"lines": 12021,
"weight": 1
},
{
"name": "stackexchange_title_body/christianity.stackexchange.com.jsonl.gz",
"lines": 12108,
"weight": 1
},
{
"name": "stackexchange_title_body/boardgames.stackexchange.com.jsonl.gz",
"lines": 12149,
"weight": 1
},
{
"name": "flickr30k_captions.jsonl.gz",
"lines": 317695,
"weight": 1
},
{
"name": "coco_captions.jsonl.gz",
"lines": 828395,
"weight": 1
},
{
"name": "codesearchnet.jsonl.gz",
"lines": 1151414,
"weight": 1
},
{
"name": "stackexchange_title_body/civicrm.stackexchange.com.jsonl.gz",
"lines": 12543,
"weight": 2
},
{
"name": "stackexchange_title_body/craftcms.stackexchange.com.jsonl.gz",
"lines": 12574,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/networkengineering.stackexchange.com.jsonl.gz",
"lines": 12590,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/networkengineering.stackexchange.com.jsonl.gz",
"lines": 12590,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/space.stackexchange.com.jsonl.gz",
"lines": 12893,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/space.stackexchange.com.jsonl.gz",
"lines": 12893,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/quant.stackexchange.com.jsonl.gz",
"lines": 12933,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/quant.stackexchange.com.jsonl.gz",
"lines": 12933,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/philosophy.stackexchange.com.jsonl.gz",
"lines": 13114,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/philosophy.stackexchange.com.jsonl.gz",
"lines": 13114,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/gardening.stackexchange.com.jsonl.gz",
"lines": 13246,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/gardening.stackexchange.com.jsonl.gz",
"lines": 13246,
"weight": 2
},
{
"name": "stackexchange_title_body/hinduism.stackexchange.com.jsonl.gz",
"lines": 13450,
"weight": 2
},
{
"name": "stackexchange_title_body/networkengineering.stackexchange.com.jsonl.gz",
"lines": 13454,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/german.stackexchange.com.jsonl.gz",
"lines": 13733,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/german.stackexchange.com.jsonl.gz",
"lines": 13733,
"weight": 2
},
{
"name": "stackexchange_title_body/german.stackexchange.com.jsonl.gz",
"lines": 13950,
"weight": 2
},
{
"name": "stackexchange_title_body/philosophy.stackexchange.com.jsonl.gz",
"lines": 14829,
"weight": 2
},
{
"name": "stackexchange_title_body/gardening.stackexchange.com.jsonl.gz",
"lines": 15136,
"weight": 2
},
{
"name": "stackexchange_title_body/space.stackexchange.com.jsonl.gz",
"lines": 15142,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/bicycles.stackexchange.com.jsonl.gz",
"lines": 15708,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/bicycles.stackexchange.com.jsonl.gz",
"lines": 15708,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/law.stackexchange.com.jsonl.gz",
"lines": 16133,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/law.stackexchange.com.jsonl.gz",
"lines": 16133,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/arduino.stackexchange.com.jsonl.gz",
"lines": 16281,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/arduino.stackexchange.com.jsonl.gz",
"lines": 16281,
"weight": 2
},
{
"name": "stackexchange_title_body/bicycles.stackexchange.com.jsonl.gz",
"lines": 16353,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/emacs.stackexchange.com.jsonl.gz",
"lines": 16830,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/emacs.stackexchange.com.jsonl.gz",
"lines": 16830,
"weight": 2
},
{
"name": "stackexchange_title_body/quant.stackexchange.com.jsonl.gz",
"lines": 17261,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/dsp.stackexchange.com.jsonl.gz",
"lines": 17430,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/dsp.stackexchange.com.jsonl.gz",
"lines": 17430,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/puzzling.stackexchange.com.jsonl.gz",
"lines": 17448,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/puzzling.stackexchange.com.jsonl.gz",
"lines": 17448,
"weight": 2
},
{
"name": "stackexchange_title_body/puzzling.stackexchange.com.jsonl.gz",
"lines": 17851,
"weight": 2
},
{
"name": "stackexchange_title_body/law.stackexchange.com.jsonl.gz",
"lines": 17941,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/movies.stackexchange.com.jsonl.gz",
"lines": 18243,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/movies.stackexchange.com.jsonl.gz",
"lines": 18243,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/mechanics.stackexchange.com.jsonl.gz",
"lines": 18613,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/mechanics.stackexchange.com.jsonl.gz",
"lines": 18613,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/aviation.stackexchange.com.jsonl.gz",
"lines": 18755,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/aviation.stackexchange.com.jsonl.gz",
"lines": 18755,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/biology.stackexchange.com.jsonl.gz",
"lines": 19277,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/biology.stackexchange.com.jsonl.gz",
"lines": 19277,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/crypto.stackexchange.com.jsonl.gz",
"lines": 19404,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/crypto.stackexchange.com.jsonl.gz",
"lines": 19404,
"weight": 2
},
{
"name": "stackexchange_title_body/arduino.stackexchange.com.jsonl.gz",
"lines": 19553,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/music.stackexchange.com.jsonl.gz",
"lines": 19936,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/music.stackexchange.com.jsonl.gz",
"lines": 19936,
"weight": 2
},
{
"name": "stackexchange_title_body/aviation.stackexchange.com.jsonl.gz",
"lines": 20139,
"weight": 2
},
{
"name": "stackexchange_title_body/softwarerecs.stackexchange.com.jsonl.gz",
"lines": 20142,
"weight": 2
},
{
"name": "stackexchange_title_body/movies.stackexchange.com.jsonl.gz",
"lines": 20181,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/datascience.stackexchange.com.jsonl.gz",
"lines": 20503,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/datascience.stackexchange.com.jsonl.gz",
"lines": 20503,
"weight": 2
},
{
"name": "stackexchange_title_body/music.stackexchange.com.jsonl.gz",
"lines": 20636,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/japanese.stackexchange.com.jsonl.gz",
"lines": 20948,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/japanese.stackexchange.com.jsonl.gz",
"lines": 20948,
"weight": 2
},
{
"name": "stackexchange_title_body/emacs.stackexchange.com.jsonl.gz",
"lines": 21055,
"weight": 2
},
{
"name": "stackexchange_title_body/dsp.stackexchange.com.jsonl.gz",
"lines": 21252,
"weight": 2
},
{
"name": "stackexchange_title_body/japanese.stackexchange.com.jsonl.gz",
"lines": 22056,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/bitcoin.stackexchange.com.jsonl.gz",
"lines": 22474,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/bitcoin.stackexchange.com.jsonl.gz",
"lines": 22474,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/cooking.stackexchange.com.jsonl.gz",
"lines": 22641,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/cooking.stackexchange.com.jsonl.gz",
"lines": 22641,
"weight": 2
},
{
"name": "stackexchange_title_body/mechanics.stackexchange.com.jsonl.gz",
"lines": 22868,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/photo.stackexchange.com.jsonl.gz",
"lines": 23204,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/photo.stackexchange.com.jsonl.gz",
"lines": 23204,
"weight": 2
},
{
"name": "stackexchange_title_body/crypto.stackexchange.com.jsonl.gz",
"lines": 23231,
"weight": 2
},
{
"name": "stackexchange_title_body/cooking.stackexchange.com.jsonl.gz",
"lines": 23705,
"weight": 2
},
{
"name": "stackexchange_title_body/photo.stackexchange.com.jsonl.gz",
"lines": 23753,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/workplace.stackexchange.com.jsonl.gz",
"lines": 24012,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/workplace.stackexchange.com.jsonl.gz",
"lines": 24012,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/meta.stackoverflow.com.jsonl.gz",
"lines": 24044,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/meta.stackoverflow.com.jsonl.gz",
"lines": 24044,
"weight": 2
},
{
"name": "stackexchange_TitleBody_Answer/raspberrypi.stackexchange.com.jsonl.gz",
"lines": 24143,
"weight": 2
},
{
"name": "stackexchange_Title_Answer/raspberrypi.stackexchange.com.jsonl.gz",
"lines": 24143,
"weight": 2
},
{
"name": "stackexchange_title_body/workplace.stackexchange.com.jsonl.gz",
"lines": 24189,
"weight": 2
},
{
"name": "stackexchange_title_body/biology.stackexchange.com.jsonl.gz",
"lines": 24447,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/webapps.stackexchange.com.jsonl.gz",
"lines": 24867,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/webapps.stackexchange.com.jsonl.gz",
"lines": 24867,
"weight": 3
},
{
"name": "stackexchange_title_body/bitcoin.stackexchange.com.jsonl.gz",
"lines": 25374,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/judaism.stackexchange.com.jsonl.gz",
"lines": 26085,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/judaism.stackexchange.com.jsonl.gz",
"lines": 26085,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/ethereum.stackexchange.com.jsonl.gz",
"lines": 26124,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/ethereum.stackexchange.com.jsonl.gz",
"lines": 26124,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/worldbuilding.stackexchange.com.jsonl.gz",
"lines": 26210,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/worldbuilding.stackexchange.com.jsonl.gz",
"lines": 26210,
"weight": 3
},
{
"name": "stackexchange_title_body/worldbuilding.stackexchange.com.jsonl.gz",
"lines": 26763,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/chemistry.stackexchange.com.jsonl.gz",
"lines": 27061,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/chemistry.stackexchange.com.jsonl.gz",
"lines": 27061,
"weight": 3
},
{
"name": "stackexchange_title_body/datascience.stackexchange.com.jsonl.gz",
"lines": 27397,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/graphicdesign.stackexchange.com.jsonl.gz",
"lines": 28083,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/graphicdesign.stackexchange.com.jsonl.gz",
"lines": 28083,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/ux.stackexchange.com.jsonl.gz",
"lines": 28901,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/ux.stackexchange.com.jsonl.gz",
"lines": 28901,
"weight": 3
},
{
"name": "stackexchange_title_body/ux.stackexchange.com.jsonl.gz",
"lines": 29403,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/money.stackexchange.com.jsonl.gz",
"lines": 29404,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/money.stackexchange.com.jsonl.gz",
"lines": 29404,
"weight": 3
},
{
"name": "stackexchange_title_body/webapps.stackexchange.com.jsonl.gz",
"lines": 29697,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/cs.stackexchange.com.jsonl.gz",
"lines": 30010,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/cs.stackexchange.com.jsonl.gz",
"lines": 30010,
"weight": 3
},
{
"name": "stackexchange_title_body/graphicdesign.stackexchange.com.jsonl.gz",
"lines": 30233,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/webmasters.stackexchange.com.jsonl.gz",
"lines": 30370,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/webmasters.stackexchange.com.jsonl.gz",
"lines": 30370,
"weight": 3
},
{
"name": "stackexchange_title_body/raspberrypi.stackexchange.com.jsonl.gz",
"lines": 30625,
"weight": 3
},
{
"name": "stackexchange_title_body/money.stackexchange.com.jsonl.gz",
"lines": 32021,
"weight": 3
},
{
"name": "stackexchange_title_body/judaism.stackexchange.com.jsonl.gz",
"lines": 32028,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/academia.stackexchange.com.jsonl.gz",
"lines": 32137,
"weight": 3
},
{
"name": "stackexchange_Title_Answer/academia.stackexchange.com.jsonl.gz",
"lines": 32137,
"weight": 3
},
{
"name": "stackexchange_title_body/ethereum.stackexchange.com.jsonl.gz",
"lines": 32760,
"weight": 3
},
{
"name": "stackexchange_title_body/academia.stackexchange.com.jsonl.gz",
"lines": 34331,
"weight": 3
},
{
"name": "stackexchange_title_body/chemistry.stackexchange.com.jsonl.gz",
"lines": 34506,
"weight": 3
},
{
"name": "stackexchange_title_body/webmasters.stackexchange.com.jsonl.gz",
"lines": 34559,
"weight": 3
},
{
"name": "stackexchange_title_body/meta.stackoverflow.com.jsonl.gz",
"lines": 36456,
"weight": 3
},
{
"name": "stackexchange_TitleBody_Answer/travel.stackexchange.com.jsonl.gz",
"lines": 36533,
"weight": 4
},
{
"name": "stackexchange_Title_Answer/travel.stackexchange.com.jsonl.gz",
"lines": 36533,
"weight": 4
},
{
"name": "stackexchange_TitleBody_Answer/android.stackexchange.com.jsonl.gz",
"lines": 38077,
"weight": 4
},
{
"name": "stackexchange_Title_Answer/android.stackexchange.com.jsonl.gz",
"lines": 38077,
"weight": 4
},
{
"name": "stackexchange_title_body/cs.stackexchange.com.jsonl.gz",
"lines": 38314,
"weight": 4
},
{
"name": "stackexchange_TitleBody_Answer/gamedev.stackexchange.com.jsonl.gz",
"lines": 40154,
"weight": 4
},
{
"name": "stackexchange_Title_Answer/gamedev.stackexchange.com.jsonl.gz",
"lines": 40154,
"weight": 4
},
{
"name": "stackexchange_TitleBody_Answer/rpg.stackexchange.com.jsonl.gz",
"lines": 40435,
"weight": 4
},
{
"name": "stackexchange_Title_Answer/rpg.stackexchange.com.jsonl.gz",
"lines": 40435,
"weight": 4
},
{
"name": "stackexchange_title_body/travel.stackexchange.com.jsonl.gz",
"lines": 41227,
"weight": 4
},
{
"name": "stackexchange_TitleBody_Answer/codereview.stackexchange.com.jsonl.gz",
"lines": 41748,
"weight": 4
},
{
"name": "stackexchange_Title_Answer/codereview.stackexchange.com.jsonl.gz",
"lines": 41748,
"weight": 4
},
{
"name": "stackexchange_title_body/rpg.stackexchange.com.jsonl.gz",
"lines": 42303,
"weight": 4
},
{
"name": "stackexchange_title_body/codereview.stackexchange.com.jsonl.gz",
"lines": 45765,
"weight": 4
},
{
"name": "stackexchange_title_body/gamedev.stackexchange.com.jsonl.gz",
"lines": 46485,
"weight": 4
},
{
"name": "stackexchange_TitleBody_Answer/softwareengineering.stackexchange.com.jsonl.gz",
"lines": 51326,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/softwareengineering.stackexchange.com.jsonl.gz",
"lines": 51326,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/security.stackexchange.com.jsonl.gz",
"lines": 51355,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/security.stackexchange.com.jsonl.gz",
"lines": 51355,
"weight": 5
},
{
"name": "stackexchange_title_body/android.stackexchange.com.jsonl.gz",
"lines": 51608,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/diy.stackexchange.com.jsonl.gz",
"lines": 52896,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/diy.stackexchange.com.jsonl.gz",
"lines": 52896,
"weight": 5
},
{
"name": "stackexchange_title_body/softwareengineering.stackexchange.com.jsonl.gz",
"lines": 53942,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/blender.stackexchange.com.jsonl.gz",
"lines": 54153,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/blender.stackexchange.com.jsonl.gz",
"lines": 54153,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/scifi.stackexchange.com.jsonl.gz",
"lines": 54805,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/scifi.stackexchange.com.jsonl.gz",
"lines": 54805,
"weight": 5
},
{
"name": "stackexchange_title_body/security.stackexchange.com.jsonl.gz",
"lines": 58000,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/mathematica.stackexchange.com.jsonl.gz",
"lines": 59895,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/mathematica.stackexchange.com.jsonl.gz",
"lines": 59895,
"weight": 5
},
{
"name": "stackexchange_title_body/diy.stackexchange.com.jsonl.gz",
"lines": 60083,
"weight": 5
},
{
"name": "stackexchange_TitleBody_Answer/meta.stackexchange.com.jsonl.gz",
"lines": 60744,
"weight": 5
},
{
"name": "stackexchange_Title_Answer/meta.stackexchange.com.jsonl.gz",
"lines": 60744,
"weight": 5
},
{
"name": "stackexchange_title_body/scifi.stackexchange.com.jsonl.gz",
"lines": 61528,
"weight": 6
},
{
"name": "stackexchange_TitleBody_Answer/drupal.stackexchange.com.jsonl.gz",
"lines": 67817,
"weight": 6
},
{
"name": "stackexchange_Title_Answer/drupal.stackexchange.com.jsonl.gz",
"lines": 67817,
"weight": 6
},
{
"name": "stackexchange_TitleBody_Answer/dba.stackexchange.com.jsonl.gz",
"lines": 71449,
"weight": 6
},
{
"name": "stackexchange_Title_Answer/dba.stackexchange.com.jsonl.gz",
"lines": 71449,
"weight": 6
},
{
"name": "stackexchange_title_body/mathematica.stackexchange.com.jsonl.gz",
"lines": 73131,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/ell.stackexchange.com.jsonl.gz",
"lines": 77892,
"weight": 7
},
{
"name": "stackexchange_Title_Answer/ell.stackexchange.com.jsonl.gz",
"lines": 77892,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/magento.stackexchange.com.jsonl.gz",
"lines": 79241,
"weight": 7
},
{
"name": "stackexchange_Title_Answer/magento.stackexchange.com.jsonl.gz",
"lines": 79241,
"weight": 7
},
{
"name": "stackexchange_title_body/drupal.stackexchange.com.jsonl.gz",
"lines": 79717,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/sharepoint.stackexchange.com.jsonl.gz",
"lines": 80420,
"weight": 7
},
{
"name": "stackexchange_Title_Answer/sharepoint.stackexchange.com.jsonl.gz",
"lines": 80420,
"weight": 7
},
{
"name": "stackexchange_title_body/blender.stackexchange.com.jsonl.gz",
"lines": 80766,
"weight": 7
},
{
"name": "stackexchange_title_body/dba.stackexchange.com.jsonl.gz",
"lines": 81871,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/gaming.stackexchange.com.jsonl.gz",
"lines": 82887,
"weight": 7
},
{
"name": "stackexchange_Title_Answer/gaming.stackexchange.com.jsonl.gz",
"lines": 82887,
"weight": 7
},
{
"name": "stackexchange_title_body/ell.stackexchange.com.jsonl.gz",
"lines": 83271,
"weight": 7
},
{
"name": "stackexchange_title_body/meta.stackexchange.com.jsonl.gz",
"lines": 83510,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/wordpress.stackexchange.com.jsonl.gz",
"lines": 83621,
"weight": 7
},
{
"name": "stackexchange_Title_Answer/wordpress.stackexchange.com.jsonl.gz",
"lines": 83621,
"weight": 7
},
{
"name": "stackexchange_TitleBody_Answer/mathoverflow.net.jsonl.gz",
"lines": 85289,
"weight": 8
},
{
"name": "stackexchange_Title_Answer/mathoverflow.net.jsonl.gz",
"lines": 85289,
"weight": 8
},
{
"name": "stackexchange_TitleBody_Answer/salesforce.stackexchange.com.jsonl.gz",
"lines": 87272,
"weight": 8
},
{
"name": "stackexchange_Title_Answer/salesforce.stackexchange.com.jsonl.gz",
"lines": 87272,
"weight": 8
},
{
"name": "stackexchange_title_body/gaming.stackexchange.com.jsonl.gz",
"lines": 88912,
"weight": 8
},
{
"name": "stackexchange_TitleBody_Answer/apple.stackexchange.com.jsonl.gz",
"lines": 92487,
"weight": 8
},
{
"name": "stackexchange_Title_Answer/apple.stackexchange.com.jsonl.gz",
"lines": 92487,
"weight": 8
},
{
"name": "stackexchange_title_body/sharepoint.stackexchange.com.jsonl.gz",
"lines": 94011,
"weight": 8
},
{
"name": "stackexchange_title_body/magento.stackexchange.com.jsonl.gz",
"lines": 99991,
"weight": 9
},
{
"name": "stackexchange_TitleBody_Answer/gis.stackexchange.com.jsonl.gz",
"lines": 100254,
"weight": 9
},
{
"name": "stackexchange_Title_Answer/gis.stackexchange.com.jsonl.gz",
"lines": 100254,
"weight": 9
},
{
"name": "stackexchange_title_body/wordpress.stackexchange.com.jsonl.gz",
"lines": 100474,
"weight": 9
},
{
"name": "stackexchange_TitleBody_Answer/english.stackexchange.com.jsonl.gz",
"lines": 100640,
"weight": 9
},
{
"name": "stackexchange_Title_Answer/english.stackexchange.com.jsonl.gz",
"lines": 100640,
"weight": 9
},
{
"name": "stackexchange_title_body/salesforce.stackexchange.com.jsonl.gz",
"lines": 105260,
"weight": 9
},
{
"name": "stackexchange_title_body/english.stackexchange.com.jsonl.gz",
"lines": 109522,
"weight": 10
},
{
"name": "stackexchange_title_body/apple.stackexchange.com.jsonl.gz",
"lines": 110622,
"weight": 10
},
{
"name": "stackexchange_TitleBody_Answer/stats.stackexchange.com.jsonl.gz",
"lines": 115679,
"weight": 10
},
{
"name": "stackexchange_Title_Answer/stats.stackexchange.com.jsonl.gz",
"lines": 115679,
"weight": 10
},
{
"name": "stackexchange_title_body/mathoverflow.net.jsonl.gz",
"lines": 120851,
"weight": 10
},
{
"name": "stackexchange_TitleBody_Answer/electronics.stackexchange.com.jsonl.gz",
"lines": 129494,
"weight": 11
},
{
"name": "stackexchange_Title_Answer/electronics.stackexchange.com.jsonl.gz",
"lines": 129494,
"weight": 11
},
{
"name": "stackexchange_title_body/gis.stackexchange.com.jsonl.gz",
"lines": 131000,
"weight": 11
},
{
"name": "stackexchange_TitleBody_Answer/physics.stackexchange.com.jsonl.gz",
"lines": 141230,
"weight": 12
},
{
"name": "stackexchange_Title_Answer/physics.stackexchange.com.jsonl.gz",
"lines": 141230,
"weight": 12
},
{
"name": "stackexchange_title_body/electronics.stackexchange.com.jsonl.gz",
"lines": 143582,
"weight": 12
},
{
"name": "stackexchange_TitleBody_Answer/unix.stackexchange.com.jsonl.gz",
"lines": 155414,
"weight": 13
},
{
"name": "stackexchange_Title_Answer/unix.stackexchange.com.jsonl.gz",
"lines": 155414,
"weight": 13
},
{
"name": "stackexchange_TitleBody_Answer/tex.stackexchange.com.jsonl.gz",
"lines": 171628,
"weight": 15
},
{
"name": "stackexchange_Title_Answer/tex.stackexchange.com.jsonl.gz",
"lines": 171628,
"weight": 15
},
{
"name": "stackexchange_title_body/physics.stackexchange.com.jsonl.gz",
"lines": 173307,
"weight": 15
},
{
"name": "stackexchange_title_body/stats.stackexchange.com.jsonl.gz",
"lines": 173466,
"weight": 15
},
{
"name": "stackexchange_title_body/unix.stackexchange.com.jsonl.gz",
"lines": 185997,
"weight": 16
},
{
"name": "stackexchange_title_body/tex.stackexchange.com.jsonl.gz",
"lines": 202954,
"weight": 17
},
{
"name": "TriviaQA_pairs.jsonl.gz",
"lines": 73346,
"weight": 19
},
{
"name": "stackexchange_TitleBody_Answer/serverfault.com.jsonl.gz",
"lines": 238507,
"weight": 20
},
{
"name": "stackexchange_Title_Answer/serverfault.com.jsonl.gz",
"lines": 238507,
"weight": 20
},
{
"name": "stackexchange_duplicate_questions_title-body_title-body.jsonl.gz",
"lines": 250460,
"weight": 21
},
{
"name": "stackexchange_duplicate_questions_body_body.jsonl.gz",
"lines": 250519,
"weight": 21
},
{
"name": "squad_pairs.jsonl.gz",
"lines": 87599,
"weight": 22
},
{
"name": "stackexchange_TitleBody_Answer/askubuntu.com.jsonl.gz",
"lines": 267135,
"weight": 22
},
{
"name": "stackexchange_Title_Answer/askubuntu.com.jsonl.gz",
"lines": 267135,
"weight": 22
},
{
"name": "stackexchange_title_body/serverfault.com.jsonl.gz",
"lines": 270904,
"weight": 23
},
{
"name": "NQ-train_pairs.jsonl.gz",
"lines": 100231,
"weight": 25
},
{
"name": "SimpleWiki.jsonl.gz",
"lines": 102225,
"weight": 26
},
{
"name": "quora_duplicates_triplets.jsonl.gz",
"lines": 103663,
"weight": 26
},
{
"name": "stackexchange_duplicate_questions_title_title.jsonl.gz",
"lines": 304525,
"weight": 26
},
{
"name": "altlex.jsonl.gz",
"lines": 112696,
"weight": 28
},
{
"name": "stackexchange_title_body/askubuntu.com.jsonl.gz",
"lines": 347925,
"weight": 29
},
{
"name": "stackexchange_TitleBody_Answer/superuser.com.jsonl.gz",
"lines": 352610,
"weight": 30
},
{
"name": "stackexchange_Title_Answer/superuser.com.jsonl.gz",
"lines": 352610,
"weight": 30
},
{
"name": "wikihow.jsonl.gz",
"lines": 128542,
"weight": 32
},
{
"name": "stackexchange_title_body/superuser.com.jsonl.gz",
"lines": 435463,
"weight": 36
},
{
"name": "stackexchange_title_body/small_stackexchanges.jsonl.gz",
"lines": 448146,
"weight": 37
},
{
"name": "stackexchange_TitleBody_Answer/small_stackexchanges.jsonl.gz",
"lines": 460256,
"weight": 38
},
{
"name": "stackexchange_Title_Answer/small_stackexchanges.jsonl.gz",
"lines": 460256,
"weight": 38
},
{
"name": "sentence-compression.jsonl.gz",
"lines": 180000,
"weight": 45
},
{
"name": "AllNLI.jsonl.gz",
"lines": 277230,
"weight": 69
},
{
"name": "eli5_question_answer.jsonl.gz",
"lines": 325475,
"weight": 81
},
{
"name": "reddit/reddit_2015.jsonl.gz",
"lines": 135108166,
"weight": 82
},
{
"name": "reddit/reddit_2016.jsonl.gz",
"lines": 159164386,
"weight": 82
},
{
"name": "reddit/reddit_2017.jsonl.gz",
"lines": 191485219,
"weight": 82
},
{
"name": "reddit/reddit_2018.jsonl.gz",
"lines": 240726659,
"weight": 82
},
{
"name": "stackexchange_TitleBody_Answer/math.stackexchange.com.jsonl.gz",
"lines": 1100953,
"weight": 83
},
{
"name": "stackexchange_Title_Answer/math.stackexchange.com.jsonl.gz",
"lines": 1100953,
"weight": 83
},
{
"name": "stackexchange_title_body/math.stackexchange.com.jsonl.gz",
"lines": 1338443,
"weight": 83
},
{
"name": "stackexchange_TitleBody_Answer/stackoverflow.com-Posts.jsonl.gz",
"lines": 15768211,
"weight": 83
},
{
"name": "stackexchange_Title_Answer/stackoverflow.com-Posts.jsonl.gz",
"lines": 15768211,
"weight": 83
},
{
"name": "stackexchange_title_body/stackoverflow.com-Posts.jsonl.gz",
"lines": 18562443,
"weight": 83
},
{
"name": "specter_train_triples.jsonl.gz",
"lines": 684100,
"weight": 84
},
{
"name": "S2ORC_title_abstract.jsonl.gz",
"lines": 41769185,
"weight": 123
},
{
"name": "S2ORC_citation_pairs.jsonl.gz",
"lines": 52603982,
"weight": 123
},
{
"name": "PAQ_pairs.jsonl.gz",
"lines": 64371441,
"weight": 123
},
{
"name": "WikiAnswers_pairs.jsonl.gz",
"lines": 77427422,
"weight": 123
},
{
"name": "S2ORC_citation_pairs_abstract.jsonl.gz",
"lines": 116288806,
"weight": 123
},
{
"name": "searchQA_question_top5_snippets_merged.jsonl.gz",
"lines": 582261,
"weight": 144
},
{
"name": "yahoo_answers_title_question.jsonl.gz",
"lines": 659896,
"weight": 163
},
{
"name": "yahoo_answers_question_answer.jsonl.gz",
"lines": 681164,
"weight": 169
},
{
"name": "yahoo_answers_title_answer.jsonl.gz",
"lines": 1198260,
"weight": 247
},
{
"name": "amazon-qa-train-pairs.jsonl.gz",
"lines": 2448839,
"weight": 247
},
{
"name": "gooaq_pairs.jsonl.gz",
"lines": 3012496,
"weight": 247
},
{
"name": "msmarco-query_passage_negative.jsonl.gz",
"lines": 9144553,
"weight": 247
}
]123version https://git-lfs.github.com/spec/v1oid sha256:d2d541e5f101695ae495eacd867a8d025ecfe8f9674fb23aa6cf93cdb60a5542size 1334663041234567891011121314151617181920[
{
"idx": 0,
"name": "0",
"path": "",
"type": "sentence_transformers.models.Transformer"
},
{
"idx": 1,
"name": "1",
"path": "1_Pooling",
"type": "sentence_transformers.models.Pooling"
},
{
"idx": 2,
"name": "2",
"path": "2_Normalize",
"type": "sentence_transformers.models.Normalize"
}
]123version https://git-lfs.github.com/spec/v1oid sha256:54609dea3ff88f3167f049eeadbfe780b1173a3117bfac862134ebcd8ce33661size 133506609123version https://git-lfs.github.com/spec/v1oid sha256:e6187a3017729198d4f826677a4d9f42b16da2052c1a6df2518587596702867dsize 1335041151234{
"max_seq_length": 128,
"do_lower_case": false
}1{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}1{"do_lower_case": true, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "name_or_path": "microsoft/MiniLM-L12-H384-uncased", "do_basic_tokenize": true, "never_split": null, "tokenizer_class": "BertTokenizer", "model_max_length": 512}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344"""
Train script for a single file
Need to set the TPU address first:
export XRT_TPU_CONFIG="localservice;0;localhost:51011"
"""
import torch.multiprocessing as mp
import threading
import time
import random
import sys
import argparse
import gzip
import json
import logging
import tqdm
import torch
from torch import nn
from torch.utils.data import DataLoader
import torch
import torch_xla
import torch_xla.core
import torch_xla.core.functions
import torch_xla.core.xla_model as xm
import torch_xla.distributed.xla_multiprocessing as xmp
import torch_xla.distributed.parallel_loader as pl
import os
from shutil import copyfile
from transformers import (
AdamW,
AutoModel,
AutoTokenizer,
get_linear_schedule_with_warmup,
set_seed,
)
class AutoModelForSentenceEmbedding(nn.Module):
def __init__(self, model_name, tokenizer, normalize=True):
super(AutoModelForSentenceEmbedding, self).__init__()
self.model = AutoModel.from_pretrained(model_name)
self.normalize = normalize
self.tokenizer = tokenizer
def forward(self, **kwargs):
model_output = self.model(**kwargs)
embeddings = self.mean_pooling(model_output, kwargs['attention_mask'])
if self.normalize:
embeddings = torch.nn.functional.normalize(embeddings, p=2, dim=1)
return embeddings
def mean_pooling(self, model_output, attention_mask):
token_embeddings = model_output[0] # First element of model_output contains all token embeddings
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
def save_pretrained(self, output_path):
if xm.is_master_ordinal():
self.tokenizer.save_pretrained(output_path)
self.model.config.save_pretrained(output_path)
xm.save(self.model.state_dict(), os.path.join(output_path, "pytorch_model.bin"))
def train_function(index, args, queue):
tokenizer = AutoTokenizer.from_pretrained(args.model)
model = AutoModelForSentenceEmbedding(args.model, tokenizer)
### Train Loop
device = xm.xla_device()
model = model.to(device)
# Instantiate optimizer
optimizer = AdamW(params=model.parameters(), lr=2e-5, correct_bias=True)
lr_scheduler = get_linear_schedule_with_warmup(
optimizer=optimizer,
num_warmup_steps=500,
num_training_steps=args.steps,
)
# Now we train the model
cross_entropy_loss = nn.CrossEntropyLoss()
max_grad_norm = 1
model.train()
for global_step in tqdm.trange(args.steps, disable=not xm.is_master_ordinal()):
#### Get the batch data
batch = queue.get()
#print(index, "batch {}x{}".format(len(batch), ",".join([str(len(b)) for b in batch])))
if len(batch[0]) == 2: #(anchor, positive)
text1 = tokenizer([b[0] for b in batch], return_tensors="pt", max_length=args.max_length, truncation=True, padding="max_length")
text2 = tokenizer([b[1] for b in batch], return_tensors="pt", max_length=args.max_length, truncation=True, padding="max_length")
### Compute embeddings
embeddings_a = model(**text1.to(device))
embeddings_b = model(**text2.to(device))
### Gather all embedings
embeddings_a = torch_xla.core.functions.all_gather(embeddings_a)
embeddings_b = torch_xla.core.functions.all_gather(embeddings_b)
### Compute similarity scores 512 x 512
scores = torch.mm(embeddings_a, embeddings_b.transpose(0, 1)) * args.scale
### Compute cross-entropy loss
labels = torch.tensor(range(len(scores)), dtype=torch.long, device=embeddings_a.device) # Example a[i] should match with b[i]
## Symmetric loss as in CLIP
loss = (cross_entropy_loss(scores, labels) + cross_entropy_loss(scores.transpose(0, 1), labels)) / 2
else: #(anchor, positive, negative)
text1 = tokenizer([b[0] for b in batch], return_tensors="pt", max_length=args.max_length, truncation=True, padding="max_length")
text2 = tokenizer([b[1] for b in batch], return_tensors="pt", max_length=args.max_length, truncation=True, padding="max_length")
text3 = tokenizer([b[2] for b in batch], return_tensors="pt", max_length=args.max_length, truncation=True, padding="max_length")
embeddings_a = model(**text1.to(device))
embeddings_b1 = model(**text2.to(device))
embeddings_b2 = model(**text3.to(device))
embeddings_a = torch_xla.core.functions.all_gather(embeddings_a)
embeddings_b1 = torch_xla.core.functions.all_gather(embeddings_b1)
embeddings_b2 = torch_xla.core.functions.all_gather(embeddings_b2)
embeddings_b = torch.cat([embeddings_b1, embeddings_b2])
### Compute similarity scores 512 x 1024
scores = torch.mm(embeddings_a, embeddings_b.transpose(0, 1)) * args.scale
### Compute cross-entropy loss
labels = torch.tensor(range(len(scores)), dtype=torch.long, device=embeddings_a.device) # Example a[i] should match with b[i]
## One-way loss
loss = cross_entropy_loss(scores, labels)
# Backward pass
optimizer.zero_grad()
loss.backward()
torch.nn.utils.clip_grad_norm_(model.parameters(), max_grad_norm)
xm.optimizer_step(optimizer, barrier=True)
lr_scheduler.step()
#Save model
if (global_step+1) % args.save_steps == 0:
output_path = os.path.join(args.output, str(global_step+1))
xm.master_print("save model: "+output_path)
model.save_pretrained(output_path)
output_path = os.path.join(args.output, "final")
xm.master_print("save model final: "+ output_path)
model.save_pretrained(output_path)
def produce_data(args, queue, filepaths, dataset_indices):
global_batch_size = args.batch_size*args.nprocs #Global batch size
size_per_dataset = int(global_batch_size / args.datasets_per_batch) #How many datasets per batch
num_same_dataset = int(size_per_dataset / args.batch_size)
print("producer", "global_batch_size", global_batch_size)
print("producer", "size_per_dataset", size_per_dataset)
print("producer", "num_same_dataset", num_same_dataset)
datasets = []
for filepath in filepaths:
if "reddit_" in filepath: #Special dataset class for Reddit files
data_obj = RedditDataset(filepath)
else:
data_obj = Dataset(filepath)
datasets.append(iter(data_obj))
# Store if dataset is in a 2 col or 3 col format
num_cols = {idx: len(next(dataset)) for idx, dataset in enumerate(datasets)}
while True:
texts_in_batch = set()
batch_format = None #2 vs 3 col format for this batch
#Add data from several sub datasets
for _ in range(args.datasets_per_batch):
valid_dataset = False #Check that datasets have the same 2/3 col format
while not valid_dataset:
data_idx = random.choice(dataset_indices)
if batch_format is None:
batch_format = num_cols[data_idx]
valid_dataset = True
else: #Check that this dataset has the same format
valid_dataset = (batch_format == num_cols[data_idx])
#Get data from this dataset
dataset = datasets[data_idx]
for _ in range(num_same_dataset):
for _ in range(args.nprocs):
batch_device = [] #A batch for one device
while len(batch_device) < args.batch_size:
sample = next(dataset)
in_batch = False
for text in sample:
if text in texts_in_batch:
in_batch = True
break
if not in_batch:
for text in sample:
texts_in_batch.add(text)
batch_device.append(sample)
queue.put(batch_device)
class RedditDataset:
"""
A class that handles the reddit data files
"""
def __init__(self, filepath):
self.filepath = filepath
def __iter__(self):
while True:
with gzip.open(self.filepath, "rt") as fIn:
for line in fIn:
data = json.loads(line)
if "response" in data and "context" in data:
yield [data["response"], data["context"]]
class Dataset:
"""
A class that handles one dataset
"""
def __init__(self, filepath):
self.filepath = filepath
def __iter__(self):
max_dataset_size = 10*1000*1000 #Cache small datasets in memory
dataset = []
data_format = None
while dataset is None or len(dataset) == 0:
with gzip.open(self.filepath, "rt") as fIn:
for line in fIn:
data = json.loads(line)
if isinstance(data, dict):
data = data['texts']
if data_format is None:
data_format = len(data)
#Ensure that all entries are of the same 2/3 col format
assert len(data) == data_format
if dataset is not None:
dataset.append(data)
if len(dataset) >= max_dataset_size:
dataset = None
yield data
# Data loaded. Now stream to the queue
# Shuffle for each epoch
while True:
random.shuffle(dataset)
for data in dataset:
yield data
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--model', default='nreimers/MiniLM-L6-H384-uncased')
parser.add_argument('--steps', type=int, default=2000)
parser.add_argument('--save_steps', type=int, default=10000)
parser.add_argument('--batch_size', type=int, default=64)
parser.add_argument('--max_length', type=int, default=128)
parser.add_argument('--nprocs', type=int, default=8)
parser.add_argument('--datasets_per_batch', type=int, default=2, help="Number of datasets per batch")
parser.add_argument('--scale', type=float, default=20, help="Use 20 for cossim, and 1 when you work with unnormalized embeddings with dot product")
parser.add_argument('--data_folder', default="/data", help="Folder with your dataset files")
parser.add_argument('data_config', help="A data_config.json file")
parser.add_argument('output')
args = parser.parse_args()
# Ensure global batch size is divisble by data_sample_size
assert (args.batch_size*args.nprocs) % args.datasets_per_batch == 0
logging.info("Output: "+args.output)
if os.path.exists(args.output):
print("Output folder already exists.")
input("Continue?")
# Write train script to output path
os.makedirs(args.output, exist_ok=True)
data_config_path = os.path.join(args.output, 'data_config.json')
copyfile(args.data_config, data_config_path)
train_script_path = os.path.join(args.output, 'train_script.py')
copyfile(__file__, train_script_path)
with open(train_script_path, 'a') as fOut:
fOut.write("\n\n# Script was called via:\n#python " + " ".join(sys.argv))
#Load data config
with open(args.data_config) as fIn:
data_config = json.load(fIn)
queue = mp.Queue(maxsize=100*args.nprocs)
filepaths = []
dataset_indices = []
for idx, data in enumerate(data_config):
filepaths.append(os.path.join(os.path.expanduser(args.data_folder), data['name']))
dataset_indices.extend([idx]*data['weight'])
# Start producer
p = mp.Process(target=produce_data, args=(args, queue, filepaths, dataset_indices))
p.start()
# Run training
print("Start processes:", args.nprocs)
xmp.spawn(train_function, args=(args, queue), nprocs=args.nprocs, start_method='fork')
print("Training done")
print("It might be that not all processes exit automatically. In that case you must manually kill this process.")
print("With 'pkill python' you can kill all remaining python processes")
p.kill()
exit()
# Script was called via:
#python train_many_data_files_v2.py --steps 1000000 --batch_size 128 --model microsoft/MiniLM-L12-H384-uncased train_data_configs/all_datasets_v4.json output/all_datasets_v4_MiniLM-L12-H384-uncased-batch128.gitattributes+28-35
README.md+174
config.jsonAdded+24
config_sentence_transformers.jsonAdded+7
data_config.jsonAdded+1452
model.safetensorsAdded+3
modules.jsonAdded+20
pytorch_model.binAdded+3
rust_model.otAdded+3
sentence_bert_config.jsonAdded+4
special_tokens_map.jsonAdded+1
tokenizer.jsonAdded
tokenizer_config.jsonAdded+1
train_script.pyAdded+344
vocab.txtAdded