# embeddings_queue

created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: e3c49845-cb14-4a13-bb3e-9aeef8dd5ed5
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/pipeline_webserver", "title": "Using pipelines for a webserver", "tokens": 1467, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"e3c49845-cb14-4a13-bb3e-9aeef8dd5ed5\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"014f695b-a4d3-4474-94ce-19680b0f6063\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"4833f52239d8ecf22c2fa5e74690dbc8e6cee4387648bcf70bbe622fd6edc308\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"4bb241e3-d6bb-4688-9488-967f97e17c24\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"31874c9931bb2a115e2638d7c5b9a26e10bc5f1f8f2cd2db3824b9ae774bdac2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2361, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "ref_doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "chroma:document": "<!--\u26a0\ufe0f Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be\nrendered properly in your Markdown viewer.\n-->\n\n# Using pipelines for a webserver\n\n<Tip>\nCreating an inference engine is a complex topic, and the \"best\" solution \nwill most likely depend on your problem space. Are you on CPU or GPU? Do\nyou want the lowest latency, the highest throughput, support for\nmany models, or just highly optimize 1 specific model?\nThere are many ways to tackle this topic, so what we are going to present is a good default\nto get started which may not necessarily be the most optimal solution for you.\n</Tip>\n\n\nThe key thing to understand is that we can use an iterator, just like you would [on a\ndataset](pipeline_tutorial#using-pipelines-on-a-dataset), since a webserver is basically a system that waits for requests and\ntreats them as they come in.\n\nUsually webservers are multiplexed (multithreaded, async, etc..) to handle various\nrequests concurrently. Pipelines on the other hand (and mostly the underlying models)\nare not really great for parallelism; they take up a lot of RAM, so it's best to give them all the available resources when they are running or it's a compute-intensive job.\n\nWe are going to solve that by having the webserver handle the light load of receiving\nand sending requests, and having a single thread handling the actual work.\nThis example is going to use `starlette`. The actual framework is not really\nimportant, but you might have to tune or change the code if you are using another\none to achieve the same effect.\n\nCreate `server.py`:\n\n```py\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse\nfrom starlette.routing import Route\nfrom transformers import pipeline\nimport asyncio\n\n\nasync def homepage(request):\n    payload = await request.body()\n    string = payload.decode(\"utf-8\")\n    response_q = asyncio.Queue()\n    await request.app.model_queue.put((string, response_q))\n    output = await response_q.get()\n    return JSONResponse(output)\n\n\nasync def server_loop(q):\n    pipe = pipeline(model=\"google-bert/bert-base-uncased\")\n    while True:\n        (string, response_q) = await q.get()\n        out = pipe(string)\n        await response_q.put(out)\n\n\napp = Starlette(\n    routes=[\n        Route(\"/\", homepage, methods=[\"POST\"]),\n    ],\n)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 4bb241e3-d6bb-4688-9488-967f97e17c24
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/pipeline_webserver", "title": "Using pipelines for a webserver", "tokens": 1467, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"4bb241e3-d6bb-4688-9488-967f97e17c24\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"014f695b-a4d3-4474-94ce-19680b0f6063\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"4833f52239d8ecf22c2fa5e74690dbc8e6cee4387648bcf70bbe622fd6edc308\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e3c49845-cb14-4a13-bb3e-9aeef8dd5ed5\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"7ed842c217e658042d2f6531b9e7e292bc7198a3ca29657bd8f6b80c84e42389\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f8487a74-e968-4b14-9b84-ea9bef3e4295\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"86fe1179852aefe265940043d5a2d81a7ff6bf32971e1850fd31cc2fdaea0569\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 659, \"end_char_idx\": 4351, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "ref_doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "chroma:document": "The key thing to understand is that we can use an iterator, just like you would [on a\ndataset](pipeline_tutorial#using-pipelines-on-a-dataset), since a webserver is basically a system that waits for requests and\ntreats them as they come in.\n\nUsually webservers are multiplexed (multithreaded, async, etc..) to handle various\nrequests concurrently. Pipelines on the other hand (and mostly the underlying models)\nare not really great for parallelism; they take up a lot of RAM, so it's best to give them all the available resources when they are running or it's a compute-intensive job.\n\nWe are going to solve that by having the webserver handle the light load of receiving\nand sending requests, and having a single thread handling the actual work.\nThis example is going to use `starlette`. The actual framework is not really\nimportant, but you might have to tune or change the code if you are using another\none to achieve the same effect.\n\nCreate `server.py`:\n\n```py\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse\nfrom starlette.routing import Route\nfrom transformers import pipeline\nimport asyncio\n\n\nasync def homepage(request):\n    payload = await request.body()\n    string = payload.decode(\"utf-8\")\n    response_q = asyncio.Queue()\n    await request.app.model_queue.put((string, response_q))\n    output = await response_q.get()\n    return JSONResponse(output)\n\n\nasync def server_loop(q):\n    pipe = pipeline(model=\"google-bert/bert-base-uncased\")\n    while True:\n        (string, response_q) = await q.get()\n        out = pipe(string)\n        await response_q.put(out)\n\n\napp = Starlette(\n    routes=[\n        Route(\"/\", homepage, methods=[\"POST\"]),\n    ],\n)\n\n\n@app.on_event(\"startup\")\nasync def startup_event():\n    q = asyncio.Queue()\n    app.model_queue = q\n    asyncio.create_task(server_loop(q))\n```\n\nNow you can start it with:\n```bash\nuvicorn server:app\n```\n\nAnd you can query it:\n```bash\ncurl -X POST -d \"test [MASK]\" http://localhost:8000/\n#[{\"score\":0.7742936015129089,\"token\":1012,\"token_str\":\".\",\"sequence\":\"test.\"},...]\n```\n\nAnd there you go, now you have a good idea of how to create a webserver!\n\nWhat is really important is that we load the model only **once**, so there are no copies\nof the model on the webserver. This way, no unnecessary RAM is being used.\nThen the queuing mechanism allows you to do fancy stuff like maybe accumulating a few\nitems before inferring to use dynamic batching:\n\n<Tip warning={true}>\n\nThe code sample below is intentionally written like pseudo-code for readability.\nDo not run this without checking if it makes sense for your system resources!\n\n</Tip>\n\n```py\n(string, rq) = await q.get()\nstrings = []\nqueues = []\nwhile True:\n    try:\n        (string, rq) = await asyncio.wait_for(q.get(), timeout=0.001)  # 1ms\n    except asyncio.exceptions.TimeoutError:\n        break\n    strings.append(string)\n    queues.append(rq)\nstrings\nouts = pipe(strings, batch_size=len(strings))\nfor rq, out in zip(queues, outs):\n    await rq.put(out)\n```\n\nAgain, the proposed code is optimized for readability, not for being the best code.\nFirst of all, there's no batch size limit which is usually not a \ngreat idea. Next, the timeout is reset on every queue fetch, meaning you could\nwait much more than 1ms before running the inference (delaying the first request \nby that much). \n\nIt would be better to have a single 1ms deadline.\n\nThis will always wait for 1ms even if the queue is empty, which might not be the\nbest since you probably want to start doing inference if there's nothing in the queue.\nBut maybe it does make sense if batching is really crucial for your use case.\nAgain, there's really no one best solution."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: f8487a74-e968-4b14-9b84-ea9bef3e4295
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/pipeline_webserver", "title": "Using pipelines for a webserver", "tokens": 1467, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"f8487a74-e968-4b14-9b84-ea9bef3e4295\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"014f695b-a4d3-4474-94ce-19680b0f6063\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"4833f52239d8ecf22c2fa5e74690dbc8e6cee4387648bcf70bbe622fd6edc308\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4bb241e3-d6bb-4688-9488-967f97e17c24\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/pipeline_webserver\", \"title\": \"Using pipelines for a webserver\", \"tokens\": 1467, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"ccbe9e805dc59f5a009ae137bb6daed2dd5679278091b5a7e55afad0766cc661\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4354, \"end_char_idx\": 6456, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "ref_doc_id": "014f695b-a4d3-4474-94ce-19680b0f6063", "chroma:document": "## Few things you might want to consider\n\n### Error checking\n\nThere's a lot that can go wrong in production: out of memory, out of space,\nloading the model might fail, the query might be wrong, the query might be\ncorrect but still fail to run because of a model misconfiguration, and so on.\n\nGenerally, it's good if the server outputs the errors to the user, so\nadding a lot of `try..except` statements to show those errors is a good\nidea. But keep in mind it may also be a security risk to reveal all those errors depending \non your security context.\n\n### Circuit breaking\n\nWebservers usually look better when they do circuit breaking. It means they \nreturn proper errors when they're overloaded instead of just waiting for the query indefinitely. Return a 503 error instead of waiting for a super long time or a 504 after a long time.\n\nThis is relatively easy to implement in the proposed code since there is a single queue.\nLooking at the queue size is a basic way to start returning errors before your \nwebserver fails under load.\n\n### Blocking the main thread\n\nCurrently PyTorch is not async aware, and computation will block the main\nthread while running. That means it would be better if PyTorch was forced to run\non its own thread/process. This wasn't done here because the code is a lot more\ncomplex (mostly because threads and async and queues don't play nice together).\nBut ultimately it does the same thing.\n\nThis would be important if the inference of single items were long (> 1s) because \nin this case, it means every query during inference would have to wait for 1s before\neven receiving an error.\n\n### Dynamic batching\n\nIn general, batching is not necessarily an improvement over passing 1 item at \na time (see [batching details](./main_classes/pipelines#pipeline-batching) for more information). But it can be very effective\nwhen used in the correct setting. In the API, there is no dynamic\nbatching by default (too much opportunity for a slowdown). But for BLOOM inference -\nwhich is a very large model - dynamic batching is **essential** to provide a decent experience for everyone."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 84ee3cde-95ad-4b84-b3c7-95174a2787ac
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"84ee3cde-95ad-4b84-b3c7-95174a2787ac\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"25001e7e-45df-4a9a-82fe-97aa2b82ea0d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"db3529fe6abeda9c5d241bad9e2a829cc3ea91c3fdedb579edc6c756ecd10fb9\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2987, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "# Summary of the tokenizers\n\n[[open-in-colab]]\n\nOn this page, we will have a closer look at tokenization.\n\n<Youtube id=\"VFp38yj8h3A\"/>\n\nAs we saw in [the preprocessing tutorial](preprocessing), tokenizing a text is splitting it into words or\nsubwords, which then are converted to ids through a look-up table. Converting words or subwords to ids is\nstraightforward, so in this summary, we will focus on splitting a text into words or subwords (i.e. tokenizing a text).\nMore specifically, we will look at the three main types of tokenizers used in \ud83e\udd17 Transformers: [Byte-Pair Encoding\n(BPE)](#byte-pair-encoding), [WordPiece](#wordpiece), and [SentencePiece](#sentencepiece), and show examples\nof which tokenizer type is used by which model.\n\nNote that on each model page, you can look at the documentation of the associated tokenizer to know which tokenizer\ntype was used by the pretrained model. For instance, if we look at [`BertTokenizer`], we can see\nthat the model uses [WordPiece](#wordpiece).\n\n## Introduction\n\nSplitting a text into smaller chunks is a task that is harder than it looks, and there are multiple ways of doing so.\nFor instance, let's look at the sentence `\"Don't you love \ud83e\udd17 Transformers? We sure do.\"`\n\n<Youtube id=\"nhJxYji1aho\"/>\n\nA simple way of tokenizing this text is to split it by spaces, which would give:\n\n```\n[\"Don't\", \"you\", \"love\", \"\ud83e\udd17\", \"Transformers?\", \"We\", \"sure\", \"do.\"]\n```\n\nThis is a sensible first step, but if we look at the tokens `\"Transformers?\"` and `\"do.\"`, we notice that the\npunctuation is attached to the words `\"Transformer\"` and `\"do\"`, which is suboptimal. We should take the\npunctuation into account so that a model does not have to learn a different representation of a word and every possible\npunctuation symbol that could follow it, which would explode the number of representations the model has to learn.\nTaking punctuation into account, tokenizing our exemplary text would give:\n\n```\n[\"Don\", \"'\", \"t\", \"you\", \"love\", \"\ud83e\udd17\", \"Transformers\", \"?\", \"We\", \"sure\", \"do\", \".\"]\n```\n\nBetter. However, it is disadvantageous, how the tokenization dealt with the word `\"Don't\"`. `\"Don't\"` stands for\n`\"do not\"`, so it would be better tokenized as `[\"Do\", \"n't\"]`. This is where things start getting complicated, and\npart of the reason each model has its own tokenizer type. Depending on the rules we apply for tokenizing a text, a\ndifferent tokenized output is generated for the same text. A pretrained model only performs properly if you feed it an\ninput that was tokenized with the same rules that were used to tokenize its training data.\n\n[spaCy](https://spacy.io/) and [Moses](http://www.statmt.org/moses/?n=Development.GetStarted) are two popular\nrule-based tokenizers. Applying them on our example, *spaCy* and *Moses* would output something like:\n\n```\n[\"Do\", \"n't\", \"you\", \"love\", \"\ud83e\udd17\", \"Transformers\", \"?\", \"We\", \"sure\", \"do\", \".\"]\n```\n\nAs can be seen space and punctuation tokenization, as well as rule-based tokenization, is used here."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 25001e7e-45df-4a9a-82fe-97aa2b82ea0d
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"25001e7e-45df-4a9a-82fe-97aa2b82ea0d\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"84ee3cde-95ad-4b84-b3c7-95174a2787ac\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"b4107365c574a29fd3ecf651cd1c9ea038b3132b0411c805270aef3c8a552123\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a6964189-721b-4bb9-8f07-6efbad181a44\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"12952e2eeb2e588dcf770a55cc4742f6cb495c4da0b3005a36eed67e9427fe04\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 1486, \"end_char_idx\": 4839, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "\"` and `\"do.\"`, we notice that the\npunctuation is attached to the words `\"Transformer\"` and `\"do\"`, which is suboptimal. We should take the\npunctuation into account so that a model does not have to learn a different representation of a word and every possible\npunctuation symbol that could follow it, which would explode the number of representations the model has to learn.\nTaking punctuation into account, tokenizing our exemplary text would give:\n\n```\n[\"Don\", \"'\", \"t\", \"you\", \"love\", \"\ud83e\udd17\", \"Transformers\", \"?\", \"We\", \"sure\", \"do\", \".\"]\n```\n\nBetter. However, it is disadvantageous, how the tokenization dealt with the word `\"Don't\"`. `\"Don't\"` stands for\n`\"do not\"`, so it would be better tokenized as `[\"Do\", \"n't\"]`. This is where things start getting complicated, and\npart of the reason each model has its own tokenizer type. Depending on the rules we apply for tokenizing a text, a\ndifferent tokenized output is generated for the same text. A pretrained model only performs properly if you feed it an\ninput that was tokenized with the same rules that were used to tokenize its training data.\n\n[spaCy](https://spacy.io/) and [Moses](http://www.statmt.org/moses/?n=Development.GetStarted) are two popular\nrule-based tokenizers. Applying them on our example, *spaCy* and *Moses* would output something like:\n\n```\n[\"Do\", \"n't\", \"you\", \"love\", \"\ud83e\udd17\", \"Transformers\", \"?\", \"We\", \"sure\", \"do\", \".\"]\n```\n\nAs can be seen space and punctuation tokenization, as well as rule-based tokenization, is used here. Space and\npunctuation tokenization and rule-based tokenization are both examples of word tokenization, which is loosely defined\nas splitting sentences into words. While it's the most intuitive way to split texts into smaller chunks, this\ntokenization method can lead to problems for massive text corpora. In this case, space and punctuation tokenization\nusually generates a very big vocabulary (the set of all unique words and tokens used). *E.g.*, [Transformer XL](model_doc/transfo-xl) uses space and punctuation tokenization, resulting in a vocabulary size of 267,735!\n\nSuch a big vocabulary size forces the model to have an enormous embedding matrix as the input and output layer, which\ncauses both an increased memory and time complexity. In general, transformers models rarely have a vocabulary size\ngreater than 50,000, especially if they are pretrained only on a single language.\n\nSo if simple space and punctuation tokenization is unsatisfactory, why not simply tokenize on characters?\n\n<Youtube id=\"ssLq_EK2jLE\"/>\n\nWhile character tokenization is very simple and would greatly reduce memory and time complexity it makes it much harder\nfor the model to learn meaningful input representations. *E.g.* learning a meaningful context-independent\nrepresentation for the letter `\"t\"` is much harder than learning a context-independent representation for the word\n`\"today\"`. Therefore, character tokenization is often accompanied by a loss of performance. So to get the best of\nboth worlds, transformers models use a hybrid between word-level and character-level tokenization called **subword**\ntokenization.\n\n## Subword tokenization\n\n<Youtube id=\"zHvTiHr506c\"/>\n\nSubword tokenization algorithms rely on the principle that frequently used words should not be split into smaller\nsubwords, but rare words should be decomposed into meaningful subwords."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a6964189-721b-4bb9-8f07-6efbad181a44
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"a6964189-721b-4bb9-8f07-6efbad181a44\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"25001e7e-45df-4a9a-82fe-97aa2b82ea0d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"4d8384c600f509ba2d625704447b36a31adb723c5a02af4cc0d5c4f3f221dca6\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0c53c19f-e780-4e32-a121-422b1320158c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6cd62ebc4905a3ea204968a163181fe8fd52ef3f38fb71d2404c14e9a275a605\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2988, \"end_char_idx\": 6346, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "Space and\npunctuation tokenization and rule-based tokenization are both examples of word tokenization, which is loosely defined\nas splitting sentences into words. While it's the most intuitive way to split texts into smaller chunks, this\ntokenization method can lead to problems for massive text corpora. In this case, space and punctuation tokenization\nusually generates a very big vocabulary (the set of all unique words and tokens used). *E.g.*, [Transformer XL](model_doc/transfo-xl) uses space and punctuation tokenization, resulting in a vocabulary size of 267,735!\n\nSuch a big vocabulary size forces the model to have an enormous embedding matrix as the input and output layer, which\ncauses both an increased memory and time complexity. In general, transformers models rarely have a vocabulary size\ngreater than 50,000, especially if they are pretrained only on a single language.\n\nSo if simple space and punctuation tokenization is unsatisfactory, why not simply tokenize on characters?\n\n<Youtube id=\"ssLq_EK2jLE\"/>\n\nWhile character tokenization is very simple and would greatly reduce memory and time complexity it makes it much harder\nfor the model to learn meaningful input representations. *E.g.* learning a meaningful context-independent\nrepresentation for the letter `\"t\"` is much harder than learning a context-independent representation for the word\n`\"today\"`. Therefore, character tokenization is often accompanied by a loss of performance. So to get the best of\nboth worlds, transformers models use a hybrid between word-level and character-level tokenization called **subword**\ntokenization.\n\n## Subword tokenization\n\n<Youtube id=\"zHvTiHr506c\"/>\n\nSubword tokenization algorithms rely on the principle that frequently used words should not be split into smaller\nsubwords, but rare words should be decomposed into meaningful subwords. For instance `\"annoyingly\"` might be\nconsidered a rare word and could be decomposed into `\"annoying\"` and `\"ly\"`. Both `\"annoying\"` and `\"ly\"` as\nstand-alone subwords would appear more frequently while at the same time the meaning of `\"annoyingly\"` is kept by the\ncomposite meaning of `\"annoying\"` and `\"ly\"`. This is especially useful in agglutinative languages such as Turkish,\nwhere you can form (almost) arbitrarily long complex words by stringing together subwords.\n\nSubword tokenization allows the model to have a reasonable vocabulary size while being able to learn meaningful\ncontext-independent representations. In addition, subword tokenization enables the model to process words it has never\nseen before, by decomposing them into known subwords. For instance, the [`~transformers.BertTokenizer`] tokenizes\n`\"I have a new GPU!\"` as follows:\n\n```py\n>>> from transformers import BertTokenizer\n\n>>> tokenizer = BertTokenizer.from_pretrained(\"google-bert/bert-base-uncased\")\n>>> tokenizer.tokenize(\"I have a new GPU!\")\n[\"i\", \"have\", \"a\", \"new\", \"gp\", \"##u\", \"!\"]\n```\n\nBecause we are considering the uncased model, the sentence was lowercased first. We can see that the words `[\"i\", \"have\", \"a\", \"new\"]` are present in the tokenizer's vocabulary, but the word `\"gpu\"` is not. Consequently, the\ntokenizer splits `\"gpu\"` into known subwords: `[\"gp\" and \"##u\"]`. `\"##\"` means that the rest of the token should\nbe attached to the previous one, without space (for decoding or reversal of the tokenization)."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 0c53c19f-e780-4e32-a121-422b1320158c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"0c53c19f-e780-4e32-a121-422b1320158c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a6964189-721b-4bb9-8f07-6efbad181a44\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"e45a10d24608efaec5d2c9638fceaa8eba9cf9f815d22dc42c3d699af61707b2\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"752258fe-7bbc-4d58-b989-b97b43430db3\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"c6c5e8c3eea22dd0b14b73f8fa92e985fd47836293203981f8d77ceb9d6a0938\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4840, \"end_char_idx\": 7687, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "For instance `\"annoyingly\"` might be\nconsidered a rare word and could be decomposed into `\"annoying\"` and `\"ly\"`. Both `\"annoying\"` and `\"ly\"` as\nstand-alone subwords would appear more frequently while at the same time the meaning of `\"annoyingly\"` is kept by the\ncomposite meaning of `\"annoying\"` and `\"ly\"`. This is especially useful in agglutinative languages such as Turkish,\nwhere you can form (almost) arbitrarily long complex words by stringing together subwords.\n\nSubword tokenization allows the model to have a reasonable vocabulary size while being able to learn meaningful\ncontext-independent representations. In addition, subword tokenization enables the model to process words it has never\nseen before, by decomposing them into known subwords. For instance, the [`~transformers.BertTokenizer`] tokenizes\n`\"I have a new GPU!\"` as follows:\n\n```py\n>>> from transformers import BertTokenizer\n\n>>> tokenizer = BertTokenizer.from_pretrained(\"google-bert/bert-base-uncased\")\n>>> tokenizer.tokenize(\"I have a new GPU!\")\n[\"i\", \"have\", \"a\", \"new\", \"gp\", \"##u\", \"!\"]\n```\n\nBecause we are considering the uncased model, the sentence was lowercased first. We can see that the words `[\"i\", \"have\", \"a\", \"new\"]` are present in the tokenizer's vocabulary, but the word `\"gpu\"` is not. Consequently, the\ntokenizer splits `\"gpu\"` into known subwords: `[\"gp\" and \"##u\"]`. `\"##\"` means that the rest of the token should\nbe attached to the previous one, without space (for decoding or reversal of the tokenization).\n\nAs another example, [`~transformers.XLNetTokenizer`] tokenizes our previously exemplary text as follows:\n\n```py\n>>> from transformers import XLNetTokenizer\n\n>>> tokenizer = XLNetTokenizer.from_pretrained(\"xlnet/xlnet-base-cased\")\n>>> tokenizer.tokenize(\"Don't you love \ud83e\udd17 Transformers? We sure do.\")\n[\"\u2581Don\", \"'\", \"t\", \"\u2581you\", \"\u2581love\", \"\u2581\", \"\ud83e\udd17\", \"\u2581\", \"Transform\", \"ers\", \"?\", \"\u2581We\", \"\u2581sure\", \"\u2581do\", \".\"]\n```\n\nWe'll get back to the meaning of those `\"\u2581\"` when we look at [SentencePiece](#sentencepiece). As one can see,\nthe rare word `\"Transformers\"` has been split into the more frequent subwords `\"Transform\"` and `\"ers\"`.\n\nLet's now look at how the different subword tokenization algorithms work. Note that all of those tokenization\nalgorithms rely on some form of training which is usually done on the corpus the corresponding model will be trained\non.\n\n<a id='byte-pair-encoding'></a>\n\n### Byte-Pair Encoding (BPE)\n\nByte-Pair Encoding (BPE) was introduced in [Neural Machine Translation of Rare Words with Subword Units (Sennrich et\nal., 2015)](https://arxiv.org/abs/1508.07909). BPE relies on a pre-tokenizer that splits the training data into\nwords. Pretokenization can be as simple as space tokenization, e.g. [GPT-2](model_doc/gpt2), [RoBERTa](model_doc/roberta). More advanced pre-tokenization include rule-based tokenization, e.g."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 752258fe-7bbc-4d58-b989-b97b43430db3
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"752258fe-7bbc-4d58-b989-b97b43430db3\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0c53c19f-e780-4e32-a121-422b1320158c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"1e831cb8f1e51f6ed45baf89755398201ec0d03f7739c2c6ac3ab61da2baefc1\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ffa04e0f-160d-4407-8d9f-4171185ac1e2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b463e05c505295089811a339bbdd796d62a84bc1986c11f4ea6b017a8e413dde\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6348, \"end_char_idx\": 8974, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "As another example, [`~transformers.XLNetTokenizer`] tokenizes our previously exemplary text as follows:\n\n```py\n>>> from transformers import XLNetTokenizer\n\n>>> tokenizer = XLNetTokenizer.from_pretrained(\"xlnet/xlnet-base-cased\")\n>>> tokenizer.tokenize(\"Don't you love \ud83e\udd17 Transformers? We sure do.\")\n[\"\u2581Don\", \"'\", \"t\", \"\u2581you\", \"\u2581love\", \"\u2581\", \"\ud83e\udd17\", \"\u2581\", \"Transform\", \"ers\", \"?\", \"\u2581We\", \"\u2581sure\", \"\u2581do\", \".\"]\n```\n\nWe'll get back to the meaning of those `\"\u2581\"` when we look at [SentencePiece](#sentencepiece). As one can see,\nthe rare word `\"Transformers\"` has been split into the more frequent subwords `\"Transform\"` and `\"ers\"`.\n\nLet's now look at how the different subword tokenization algorithms work. Note that all of those tokenization\nalgorithms rely on some form of training which is usually done on the corpus the corresponding model will be trained\non.\n\n<a id='byte-pair-encoding'></a>\n\n### Byte-Pair Encoding (BPE)\n\nByte-Pair Encoding (BPE) was introduced in [Neural Machine Translation of Rare Words with Subword Units (Sennrich et\nal., 2015)](https://arxiv.org/abs/1508.07909). BPE relies on a pre-tokenizer that splits the training data into\nwords. Pretokenization can be as simple as space tokenization, e.g. [GPT-2](model_doc/gpt2), [RoBERTa](model_doc/roberta). More advanced pre-tokenization include rule-based tokenization, e.g. [XLM](model_doc/xlm),\n[FlauBERT](model_doc/flaubert) which uses Moses for most languages, or [GPT](model_doc/openai-gpt) which uses\nspaCy and ftfy, to count the frequency of each word in the training corpus.\n\nAfter pre-tokenization, a set of unique words has been created and the frequency with which each word occurred in the\ntraining data has been determined. Next, BPE creates a base vocabulary consisting of all symbols that occur in the set\nof unique words and learns merge rules to form a new symbol from two symbols of the base vocabulary. It does so until\nthe vocabulary has attained the desired vocabulary size. Note that the desired vocabulary size is a hyperparameter to\ndefine before training the tokenizer.\n\nAs an example, let's assume that after pre-tokenization, the following set of words including their frequency has been\ndetermined:\n\n```\n(\"hug\", 10), (\"pug\", 5), (\"pun\", 12), (\"bun\", 4), (\"hugs\", 5)\n```\n\nConsequently, the base vocabulary is `[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\"]`. Splitting all words into symbols of the\nbase vocabulary, we obtain:\n\n```\n(\"h\" \"u\" \"g\", 10), (\"p\" \"u\" \"g\", 5), (\"p\" \"u\" \"n\", 12), (\"b\" \"u\" \"n\", 4), (\"h\" \"u\" \"g\" \"s\", 5)\n```\n\nBPE then counts the frequency of each possible symbol pair and picks the symbol pair that occurs most frequently."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ffa04e0f-160d-4407-8d9f-4171185ac1e2
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"ffa04e0f-160d-4407-8d9f-4171185ac1e2\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"752258fe-7bbc-4d58-b989-b97b43430db3\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"f52978d4a85a86594798709a74bd6d7e42892c06664611ff2c3051db5853e477\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5cc742e7-cf96-45ca-8b50-47d263d7afed\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"a14ad6ae7ead94441aaf990b0210e8524805459183184d162385a0094aa1ff39\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7619, \"end_char_idx\": 9852, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "More advanced pre-tokenization include rule-based tokenization, e.g. [XLM](model_doc/xlm),\n[FlauBERT](model_doc/flaubert) which uses Moses for most languages, or [GPT](model_doc/openai-gpt) which uses\nspaCy and ftfy, to count the frequency of each word in the training corpus.\n\nAfter pre-tokenization, a set of unique words has been created and the frequency with which each word occurred in the\ntraining data has been determined. Next, BPE creates a base vocabulary consisting of all symbols that occur in the set\nof unique words and learns merge rules to form a new symbol from two symbols of the base vocabulary. It does so until\nthe vocabulary has attained the desired vocabulary size. Note that the desired vocabulary size is a hyperparameter to\ndefine before training the tokenizer.\n\nAs an example, let's assume that after pre-tokenization, the following set of words including their frequency has been\ndetermined:\n\n```\n(\"hug\", 10), (\"pug\", 5), (\"pun\", 12), (\"bun\", 4), (\"hugs\", 5)\n```\n\nConsequently, the base vocabulary is `[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\"]`. Splitting all words into symbols of the\nbase vocabulary, we obtain:\n\n```\n(\"h\" \"u\" \"g\", 10), (\"p\" \"u\" \"g\", 5), (\"p\" \"u\" \"n\", 12), (\"b\" \"u\" \"n\", 4), (\"h\" \"u\" \"g\" \"s\", 5)\n```\n\nBPE then counts the frequency of each possible symbol pair and picks the symbol pair that occurs most frequently. In\nthe example above `\"h\"` followed by `\"u\"` is present _10 + 5 = 15_ times (10 times in the 10 occurrences of\n`\"hug\"`, 5 times in the 5 occurrences of `\"hugs\"`). However, the most frequent symbol pair is `\"u\"` followed by\n`\"g\"`, occurring _10 + 5 + 5 = 20_ times in total. Thus, the first merge rule the tokenizer learns is to group all\n`\"u\"` symbols followed by a `\"g\"` symbol together. Next, `\"ug\"` is added to the vocabulary. The set of words then\nbecomes\n\n```\n(\"h\" \"ug\", 10), (\"p\" \"ug\", 5), (\"p\" \"u\" \"n\", 12), (\"b\" \"u\" \"n\", 4), (\"h\" \"ug\" \"s\", 5)\n```\n\nBPE then identifies the next most common symbol pair. It's `\"u\"` followed by `\"n\"`, which occurs 16 times. `\"u\"`,\n`\"n\"` is merged to `\"un\"` and added to the vocabulary. The next most frequent symbol pair is `\"h\"` followed by\n`\"ug\"`, occurring 15 times. Again the pair is merged and `\"hug\"` can be added to the vocabulary."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 5cc742e7-cf96-45ca-8b50-47d263d7afed
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"5cc742e7-cf96-45ca-8b50-47d263d7afed\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ffa04e0f-160d-4407-8d9f-4171185ac1e2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"adad7afc05d3efd318b649694e6daca16233e4fb0527b69072ef7ffaa5ef3b53\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"11299249-31f9-422d-ae4f-3015062f4ee6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f03416eb1ee2ab84639acbb41e711ba0a065200d3dcd0f889f0354857f0fec62\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8688, \"end_char_idx\": 11159, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "Splitting all words into symbols of the\nbase vocabulary, we obtain:\n\n```\n(\"h\" \"u\" \"g\", 10), (\"p\" \"u\" \"g\", 5), (\"p\" \"u\" \"n\", 12), (\"b\" \"u\" \"n\", 4), (\"h\" \"u\" \"g\" \"s\", 5)\n```\n\nBPE then counts the frequency of each possible symbol pair and picks the symbol pair that occurs most frequently. In\nthe example above `\"h\"` followed by `\"u\"` is present _10 + 5 = 15_ times (10 times in the 10 occurrences of\n`\"hug\"`, 5 times in the 5 occurrences of `\"hugs\"`). However, the most frequent symbol pair is `\"u\"` followed by\n`\"g\"`, occurring _10 + 5 + 5 = 20_ times in total. Thus, the first merge rule the tokenizer learns is to group all\n`\"u\"` symbols followed by a `\"g\"` symbol together. Next, `\"ug\"` is added to the vocabulary. The set of words then\nbecomes\n\n```\n(\"h\" \"ug\", 10), (\"p\" \"ug\", 5), (\"p\" \"u\" \"n\", 12), (\"b\" \"u\" \"n\", 4), (\"h\" \"ug\" \"s\", 5)\n```\n\nBPE then identifies the next most common symbol pair. It's `\"u\"` followed by `\"n\"`, which occurs 16 times. `\"u\"`,\n`\"n\"` is merged to `\"un\"` and added to the vocabulary. The next most frequent symbol pair is `\"h\"` followed by\n`\"ug\"`, occurring 15 times. Again the pair is merged and `\"hug\"` can be added to the vocabulary.\n\nAt this stage, the vocabulary is `[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\", \"ug\", \"un\", \"hug\"]` and our set of unique words\nis represented as\n\n```\n(\"hug\", 10), (\"p\" \"ug\", 5), (\"p\" \"un\", 12), (\"b\" \"un\", 4), (\"hug\" \"s\", 5)\n```\n\nAssuming, that the Byte-Pair Encoding training would stop at this point, the learned merge rules would then be applied\nto new words (as long as those new words do not include symbols that were not in the base vocabulary). For instance,\nthe word `\"bug\"` would be tokenized to `[\"b\", \"ug\"]` but `\"mug\"` would be tokenized as `[\"<unk>\", \"ug\"]` since\nthe symbol `\"m\"` is not in the base vocabulary. In general, single letters such as `\"m\"` are not replaced by the\n`\"<unk>\"` symbol because the training data usually includes at least one occurrence of each letter, but it is likely\nto happen for very special characters like emojis.\n\nAs mentioned earlier, the vocabulary size, *i.e.* the base vocabulary size + the number of merges, is a hyperparameter\nto choose. For instance [GPT](model_doc/openai-gpt) has a vocabulary size of 40,478 since they have 478 base characters\nand chose to stop training after 40,000 merges.\n\n#### Byte-level BPE\n\nA base vocabulary that includes all possible base characters can be quite large if *e.g.* all unicode characters are\nconsidered as base characters."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 11299249-31f9-422d-ae4f-3015062f4ee6
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"11299249-31f9-422d-ae4f-3015062f4ee6\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5cc742e7-cf96-45ca-8b50-47d263d7afed\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"d1f10c997b145f86030f7d8991e45f3b36bf10ecce4fe3471949928fc5ff6bfa\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"6f2bd60c-8d54-4def-8dd4-ca8fd7a1277c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"096dc6670b28c3da7686e7d8d73d9c20b0fe65f87dc6a27c11a5a797cfc34441\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9784, \"end_char_idx\": 12819, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "Again the pair is merged and `\"hug\"` can be added to the vocabulary.\n\nAt this stage, the vocabulary is `[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\", \"ug\", \"un\", \"hug\"]` and our set of unique words\nis represented as\n\n```\n(\"hug\", 10), (\"p\" \"ug\", 5), (\"p\" \"un\", 12), (\"b\" \"un\", 4), (\"hug\" \"s\", 5)\n```\n\nAssuming, that the Byte-Pair Encoding training would stop at this point, the learned merge rules would then be applied\nto new words (as long as those new words do not include symbols that were not in the base vocabulary). For instance,\nthe word `\"bug\"` would be tokenized to `[\"b\", \"ug\"]` but `\"mug\"` would be tokenized as `[\"<unk>\", \"ug\"]` since\nthe symbol `\"m\"` is not in the base vocabulary. In general, single letters such as `\"m\"` are not replaced by the\n`\"<unk>\"` symbol because the training data usually includes at least one occurrence of each letter, but it is likely\nto happen for very special characters like emojis.\n\nAs mentioned earlier, the vocabulary size, *i.e.* the base vocabulary size + the number of merges, is a hyperparameter\nto choose. For instance [GPT](model_doc/openai-gpt) has a vocabulary size of 40,478 since they have 478 base characters\nand chose to stop training after 40,000 merges.\n\n#### Byte-level BPE\n\nA base vocabulary that includes all possible base characters can be quite large if *e.g.* all unicode characters are\nconsidered as base characters. To have a better base vocabulary, [GPT-2](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf) uses bytes\nas the base vocabulary, which is a clever trick to force the base vocabulary to be of size 256 while ensuring that\nevery base character is included in the vocabulary. With some additional rules to deal with punctuation, the GPT2's\ntokenizer can tokenize every text without the need for the <unk> symbol. [GPT-2](model_doc/gpt) has a vocabulary\nsize of 50,257, which corresponds to the 256 bytes base tokens, a special end-of-text token and the symbols learned\nwith 50,000 merges.\n\n<a id='wordpiece'></a>\n\n### WordPiece\n\nWordPiece is the subword tokenization algorithm used for [BERT](model_doc/bert), [DistilBERT](model_doc/distilbert), and [Electra](model_doc/electra). The algorithm was outlined in [Japanese and Korean\nVoice Search (Schuster et al., 2012)](https://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/37842.pdf) and is very similar to\nBPE. WordPiece first initializes the vocabulary to include every character present in the training data and\nprogressively learns a given number of merge rules. In contrast to BPE, WordPiece does not choose the most frequent\nsymbol pair, but the one that maximizes the likelihood of the training data once added to the vocabulary.\n\nSo what does this mean exactly? Referring to the previous example, maximizing the likelihood of the training data is\nequivalent to finding the symbol pair, whose probability divided by the probabilities of its first symbol followed by\nits second symbol is the greatest among all symbol pairs. *E.g."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 6f2bd60c-8d54-4def-8dd4-ca8fd7a1277c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"6f2bd60c-8d54-4def-8dd4-ca8fd7a1277c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"11299249-31f9-422d-ae4f-3015062f4ee6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"899d2eccc2ced12bbdbca304f2c8caed6a1f4fec961684e48ff25cd22d77d606\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f95b586c-451d-4218-923b-394d25b7c830\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"a199022d28c511731e84149e966ab1cece3b7efff923c849eefe3ece8bc35744\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 11160, \"end_char_idx\": 14493, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "To have a better base vocabulary, [GPT-2](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf) uses bytes\nas the base vocabulary, which is a clever trick to force the base vocabulary to be of size 256 while ensuring that\nevery base character is included in the vocabulary. With some additional rules to deal with punctuation, the GPT2's\ntokenizer can tokenize every text without the need for the <unk> symbol. [GPT-2](model_doc/gpt) has a vocabulary\nsize of 50,257, which corresponds to the 256 bytes base tokens, a special end-of-text token and the symbols learned\nwith 50,000 merges.\n\n<a id='wordpiece'></a>\n\n### WordPiece\n\nWordPiece is the subword tokenization algorithm used for [BERT](model_doc/bert), [DistilBERT](model_doc/distilbert), and [Electra](model_doc/electra). The algorithm was outlined in [Japanese and Korean\nVoice Search (Schuster et al., 2012)](https://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/37842.pdf) and is very similar to\nBPE. WordPiece first initializes the vocabulary to include every character present in the training data and\nprogressively learns a given number of merge rules. In contrast to BPE, WordPiece does not choose the most frequent\nsymbol pair, but the one that maximizes the likelihood of the training data once added to the vocabulary.\n\nSo what does this mean exactly? Referring to the previous example, maximizing the likelihood of the training data is\nequivalent to finding the symbol pair, whose probability divided by the probabilities of its first symbol followed by\nits second symbol is the greatest among all symbol pairs. *E.g.* `\"u\"`, followed by `\"g\"` would have only been\nmerged if the probability of `\"ug\"` divided by `\"u\"`, `\"g\"` would have been greater than for any other symbol\npair. Intuitively, WordPiece is slightly different to BPE in that it evaluates what it _loses_ by merging two symbols\nto ensure it's _worth it_.\n\n<a id='unigram'></a>\n\n### Unigram\n\nUnigram is a subword tokenization algorithm introduced in [Subword Regularization: Improving Neural Network Translation\nModels with Multiple Subword Candidates (Kudo, 2018)](https://arxiv.org/pdf/1804.10959.pdf). In contrast to BPE or\nWordPiece, Unigram initializes its base vocabulary to a large number of symbols and progressively trims down each\nsymbol to obtain a smaller vocabulary. The base vocabulary could for instance correspond to all pre-tokenized words and\nthe most common substrings. Unigram is not used directly for any of the models in the transformers, but it's used in\nconjunction with [SentencePiece](#sentencepiece).\n\nAt each training step, the Unigram algorithm defines a loss (often defined as the log-likelihood) over the training\ndata given the current vocabulary and a unigram language model. Then, for each symbol in the vocabulary, the algorithm\ncomputes how much the overall loss would increase if the symbol was to be removed from the vocabulary. Unigram then\nremoves p (with p usually being 10% or 20%) percent of the symbols whose loss increase is the lowest, *i.e.* those\nsymbols that least affect the overall loss over the training data. This process is repeated until the vocabulary has\nreached the desired size. The Unigram algorithm always keeps the base characters so that any word can be tokenized."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: f95b586c-451d-4218-923b-394d25b7c830
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"f95b586c-451d-4218-923b-394d25b7c830\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"6f2bd60c-8d54-4def-8dd4-ca8fd7a1277c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"1427fca741d28fbb9f7a2bd9fb37288a178cbbe71bdcca5e2e4a21af1c433d41\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ec7b47b5-e132-425d-96b6-5f15a1dae0d3\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f1e792802583c60c44ef6f9ed6afd3ea851b1f0d8c7af63f931be4901c2b39d6\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12814, \"end_char_idx\": 15869, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "*E.g.* `\"u\"`, followed by `\"g\"` would have only been\nmerged if the probability of `\"ug\"` divided by `\"u\"`, `\"g\"` would have been greater than for any other symbol\npair. Intuitively, WordPiece is slightly different to BPE in that it evaluates what it _loses_ by merging two symbols\nto ensure it's _worth it_.\n\n<a id='unigram'></a>\n\n### Unigram\n\nUnigram is a subword tokenization algorithm introduced in [Subword Regularization: Improving Neural Network Translation\nModels with Multiple Subword Candidates (Kudo, 2018)](https://arxiv.org/pdf/1804.10959.pdf). In contrast to BPE or\nWordPiece, Unigram initializes its base vocabulary to a large number of symbols and progressively trims down each\nsymbol to obtain a smaller vocabulary. The base vocabulary could for instance correspond to all pre-tokenized words and\nthe most common substrings. Unigram is not used directly for any of the models in the transformers, but it's used in\nconjunction with [SentencePiece](#sentencepiece).\n\nAt each training step, the Unigram algorithm defines a loss (often defined as the log-likelihood) over the training\ndata given the current vocabulary and a unigram language model. Then, for each symbol in the vocabulary, the algorithm\ncomputes how much the overall loss would increase if the symbol was to be removed from the vocabulary. Unigram then\nremoves p (with p usually being 10% or 20%) percent of the symbols whose loss increase is the lowest, *i.e.* those\nsymbols that least affect the overall loss over the training data. This process is repeated until the vocabulary has\nreached the desired size. The Unigram algorithm always keeps the base characters so that any word can be tokenized.\n\nBecause Unigram is not based on merge rules (in contrast to BPE and WordPiece), the algorithm has several ways of\ntokenizing new text after training. As an example, if a trained Unigram tokenizer exhibits the vocabulary:\n\n```\n[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\", \"ug\", \"un\", \"hug\"],\n```\n\n`\"hugs\"` could be tokenized both as `[\"hug\", \"s\"]`, `[\"h\", \"ug\", \"s\"]` or `[\"h\", \"u\", \"g\", \"s\"]`. So which one\nto choose? Unigram saves the probability of each token in the training corpus on top of saving the vocabulary so that\nthe probability of each possible tokenization can be computed after training. The algorithm simply picks the most\nlikely tokenization in practice, but also offers the possibility to sample a possible tokenization according to their\nprobabilities.\n\nThose probabilities are defined by the loss the tokenizer is trained on. Assuming that the training data consists of\nthe words \\\\(x_{1}, \\dots, x_{N}\\\\) and that the set of all possible tokenizations for a word \\\\(x_{i}\\\\) is\ndefined as \\\\(S(x_{i})\\\\), then the overall loss is defined as\n\n$$\\mathcal{L} = -\\sum_{i=1}^{N} \\log \\left ( \\sum_{x \\in S(x_{i})} p(x) \\right )$$\n\n<a id='sentencepiece'></a>\n\n### SentencePiece\n\nAll tokenization algorithms described so far have the same problem: It is assumed that the input text uses spaces to\nseparate words. However, not all languages use spaces to separate words."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ec7b47b5-e132-425d-96b6-5f15a1dae0d3
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/tokenizer_summary", "title": "Summary of the tokenizers", "tokens": 4431, "retrieve_doc": true, "source": "transformers", "_node_content": "{\"id_\": \"ec7b47b5-e132-425d-96b6-5f15a1dae0d3\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"af1796f7-3a48-4d41-af2e-6bd46e56ed94\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"42019efa99141d419d86ef0bac547c2ebd2bec88434d903f5446fd01d4e002d2\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f95b586c-451d-4218-923b-394d25b7c830\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/tokenizer_summary\", \"title\": \"Summary of the tokenizers\", \"tokens\": 4431, \"retrieve_doc\": true, \"source\": \"transformers\"}, \"hash\": \"6e6609527a2ac9f496a884fce72d1bb3ecb47b199d9e36befb2b06197f9e2b9a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 14404, \"end_char_idx\": 16925, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "ref_doc_id": "af1796f7-3a48-4d41-af2e-6bd46e56ed94", "chroma:document": "The Unigram algorithm always keeps the base characters so that any word can be tokenized.\n\nBecause Unigram is not based on merge rules (in contrast to BPE and WordPiece), the algorithm has several ways of\ntokenizing new text after training. As an example, if a trained Unigram tokenizer exhibits the vocabulary:\n\n```\n[\"b\", \"g\", \"h\", \"n\", \"p\", \"s\", \"u\", \"ug\", \"un\", \"hug\"],\n```\n\n`\"hugs\"` could be tokenized both as `[\"hug\", \"s\"]`, `[\"h\", \"ug\", \"s\"]` or `[\"h\", \"u\", \"g\", \"s\"]`. So which one\nto choose? Unigram saves the probability of each token in the training corpus on top of saving the vocabulary so that\nthe probability of each possible tokenization can be computed after training. The algorithm simply picks the most\nlikely tokenization in practice, but also offers the possibility to sample a possible tokenization according to their\nprobabilities.\n\nThose probabilities are defined by the loss the tokenizer is trained on. Assuming that the training data consists of\nthe words \\\\(x_{1}, \\dots, x_{N}\\\\) and that the set of all possible tokenizations for a word \\\\(x_{i}\\\\) is\ndefined as \\\\(S(x_{i})\\\\), then the overall loss is defined as\n\n$$\\mathcal{L} = -\\sum_{i=1}^{N} \\log \\left ( \\sum_{x \\in S(x_{i})} p(x) \\right )$$\n\n<a id='sentencepiece'></a>\n\n### SentencePiece\n\nAll tokenization algorithms described so far have the same problem: It is assumed that the input text uses spaces to\nseparate words. However, not all languages use spaces to separate words. One possible solution is to use language\nspecific pre-tokenizers, *e.g.* [XLM](model_doc/xlm) uses a specific Chinese, Japanese, and Thai pre-tokenizer.\nTo solve this problem more generally, [SentencePiece: A simple and language independent subword tokenizer and\ndetokenizer for Neural Text Processing (Kudo et al., 2018)](https://arxiv.org/pdf/1808.06226.pdf) treats the input\nas a raw input stream, thus including the space in the set of characters to use. It then uses the BPE or unigram\nalgorithm to construct the appropriate vocabulary.\n\nThe [`XLNetTokenizer`] uses SentencePiece for example, which is also why in the example earlier the\n`\"\u2581\"` character was included in the vocabulary. Decoding with SentencePiece is very easy since all tokens can just be\nconcatenated and `\"\u2581\"` is replaced by a space.\n\nAll transformers models in the library that use SentencePiece use it in combination with unigram. Examples of models\nusing SentencePiece are [ALBERT](model_doc/albert), [XLNet](model_doc/xlnet), [Marian](model_doc/marian), and [T5](model_doc/t5)."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 33cba0e8-d3da-42fb-9e25-30c0c636fba8
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"33cba0e8-d3da-42fb-9e25-30c0c636fba8\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"3ba0e201-a345-47a4-b8ea-99ad353957b3\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b259ba8d0f4db412c3051f2fe4331a9609ef34d1d9270717ff5e2bc90f5991a5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 2883, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "# DeepSpeed\n\n[DeepSpeed](https://www.deepspeed.ai/) is a PyTorch optimization library that makes distributed training memory-efficient and fast. At its core is the [Zero Redundancy Optimizer (ZeRO)](https://hf.co/papers/1910.02054) which enables training large models at scale. ZeRO works in several stages:\n\n* ZeRO-1, optimizer state partitioning across GPUs\n* ZeRO-2, gradient partitioning across GPUs\n* ZeRO-3, parameter partitioning across GPUs\n\nIn GPU-limited environments, ZeRO also enables offloading optimizer memory and computation from the GPU to the CPU to fit and train really large models on a single GPU. DeepSpeed is integrated with the Transformers [`Trainer`] class for all ZeRO stages and offloading. All you need to do is provide a config file or you can use a provided template. For inference, Transformers support ZeRO-3 and offloading since it allows loading huge models.\n\nThis guide will walk you through how to deploy DeepSpeed training, the features you can enable, how to setup the config files for different ZeRO stages, offloading, inference, and using DeepSpeed without the [`Trainer`].\n\n## Installation\n\nDeepSpeed is available to install from PyPI or Transformers (for more detailed installation options, take a look at the DeepSpeed [installation details](https://www.deepspeed.ai/tutorials/advanced-install/) or the GitHub [README](https://github.com/microsoft/deepspeed#installation)).\n\n<Tip>\n\nIf you're having difficulties installing DeepSpeed, check the [DeepSpeed CUDA installation](../debugging#deepspeed-cuda-installation) guide. While DeepSpeed has a pip installable PyPI package, it is highly recommended to [install it from source](https://www.deepspeed.ai/tutorials/advanced-install/#install-deepspeed-from-source) to best match your hardware and to support certain features, like 1-bit Adam, which aren\u2019t available in the PyPI distribution.\n\n</Tip>\n\n<hfoptions id=\"install\">\n<hfoption id=\"PyPI\">\n\n```bash\npip install deepspeed\n```\n\n</hfoption>\n<hfoption id=\"Transformers\">\n\n```bash\npip install transformers[deepspeed]\n```\n\n</hfoption>\n</hfoptions>\n\n## Memory requirements\n\nBefore you begin, it is a good idea to check whether you have enough GPU and CPU memory to fit your model. DeepSpeed provides a tool for estimating the required CPU/GPU memory. For example, to estimate the memory requirements for the [bigscience/T0_3B](bigscience/T0_3B) model on a single GPU:\n\n```bash\n$ python -c 'from transformers import AutoModel; \\\nfrom deepspeed.runtime.zero.stage3 import estimate_zero3_model_states_mem_needs_all_live; \\\nmodel = AutoModel.from_pretrained(\"bigscience/T0_3B\"); \\\nestimate_zero3_model_states_mem_needs_all_live(model, num_gpus_per_node=1, num_nodes=1)'\n[...]\nEstimated memory needed for params, optim states and gradients for a:\nHW: Setup with 1 node, 1 GPU per node.\nSW: Model with 2783M total params, 65M largest layer params."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 3ba0e201-a345-47a4-b8ea-99ad353957b3
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"3ba0e201-a345-47a4-b8ea-99ad353957b3\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"33cba0e8-d3da-42fb-9e25-30c0c636fba8\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"99f2398d62a4251882d0fc1e5a1038425db3984644438f7c0b6612876dbd112c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0a05eee3-763c-4f3b-aca8-c96d08ecec9a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"d426d2dbab6d384d3da2fd4eaae004d80281ba432f770744071b926c91a644de\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 1420, \"end_char_idx\": 4081, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "<Tip>\n\nIf you're having difficulties installing DeepSpeed, check the [DeepSpeed CUDA installation](../debugging#deepspeed-cuda-installation) guide. While DeepSpeed has a pip installable PyPI package, it is highly recommended to [install it from source](https://www.deepspeed.ai/tutorials/advanced-install/#install-deepspeed-from-source) to best match your hardware and to support certain features, like 1-bit Adam, which aren\u2019t available in the PyPI distribution.\n\n</Tip>\n\n<hfoptions id=\"install\">\n<hfoption id=\"PyPI\">\n\n```bash\npip install deepspeed\n```\n\n</hfoption>\n<hfoption id=\"Transformers\">\n\n```bash\npip install transformers[deepspeed]\n```\n\n</hfoption>\n</hfoptions>\n\n## Memory requirements\n\nBefore you begin, it is a good idea to check whether you have enough GPU and CPU memory to fit your model. DeepSpeed provides a tool for estimating the required CPU/GPU memory. For example, to estimate the memory requirements for the [bigscience/T0_3B](bigscience/T0_3B) model on a single GPU:\n\n```bash\n$ python -c 'from transformers import AutoModel; \\\nfrom deepspeed.runtime.zero.stage3 import estimate_zero3_model_states_mem_needs_all_live; \\\nmodel = AutoModel.from_pretrained(\"bigscience/T0_3B\"); \\\nestimate_zero3_model_states_mem_needs_all_live(model, num_gpus_per_node=1, num_nodes=1)'\n[...]\nEstimated memory needed for params, optim states and gradients for a:\nHW: Setup with 1 node, 1 GPU per node.\nSW: Model with 2783M total params, 65M largest layer params.\n  per CPU  |  per GPU |   Options\n   70.00GB |   0.25GB | offload_param=cpu , offload_optimizer=cpu , zero_init=1\n   70.00GB |   0.25GB | offload_param=cpu , offload_optimizer=cpu , zero_init=0\n   62.23GB |   5.43GB | offload_param=none, offload_optimizer=cpu , zero_init=1\n   62.23GB |   5.43GB | offload_param=none, offload_optimizer=cpu , zero_init=0\n    0.37GB |  46.91GB | offload_param=none, offload_optimizer=none, zero_init=1\n   15.56GB |  46.91GB | offload_param=none, offload_optimizer=none, zero_init=0\n```\n\nThis means you either need a single 80GB GPU without CPU offload or a 8GB GPU and a ~60GB CPU to offload to (these are just the memory requirements for the parameters, optimizer states and gradients, and you'll need a bit more for the CUDA kernels and activations). You should also consider the tradeoff between cost and speed because it'll be cheaper to rent or buy a smaller GPU but it'll take longer to train your model.\n\nIf you have enough GPU memory make sure you disable CPU/NVMe offload to make everything faster.\n\n## Select a ZeRO stage\n\nAfter you've installed DeepSpeed and have a better idea of your memory requirements, the next step is selecting a ZeRO stage to use."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 0a05eee3-763c-4f3b-aca8-c96d08ecec9a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"0a05eee3-763c-4f3b-aca8-c96d08ecec9a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"3ba0e201-a345-47a4-b8ea-99ad353957b3\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"e1ff953fc47b9cd37de0e3fde8f8612cf634650fd12bc09c7863e1d46d8c783d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"49d8e529-8fbf-442d-8f18-7522df2ce534\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"20474397d829d08f4ff0fa535341607a156dc33dc7635e05ebd4f86163aa1664\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2823, \"end_char_idx\": 5722, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "SW: Model with 2783M total params, 65M largest layer params.\n  per CPU  |  per GPU |   Options\n   70.00GB |   0.25GB | offload_param=cpu , offload_optimizer=cpu , zero_init=1\n   70.00GB |   0.25GB | offload_param=cpu , offload_optimizer=cpu , zero_init=0\n   62.23GB |   5.43GB | offload_param=none, offload_optimizer=cpu , zero_init=1\n   62.23GB |   5.43GB | offload_param=none, offload_optimizer=cpu , zero_init=0\n    0.37GB |  46.91GB | offload_param=none, offload_optimizer=none, zero_init=1\n   15.56GB |  46.91GB | offload_param=none, offload_optimizer=none, zero_init=0\n```\n\nThis means you either need a single 80GB GPU without CPU offload or a 8GB GPU and a ~60GB CPU to offload to (these are just the memory requirements for the parameters, optimizer states and gradients, and you'll need a bit more for the CUDA kernels and activations). You should also consider the tradeoff between cost and speed because it'll be cheaper to rent or buy a smaller GPU but it'll take longer to train your model.\n\nIf you have enough GPU memory make sure you disable CPU/NVMe offload to make everything faster.\n\n## Select a ZeRO stage\n\nAfter you've installed DeepSpeed and have a better idea of your memory requirements, the next step is selecting a ZeRO stage to use. In order of fastest and most memory-efficient:\n\n| Fastest          | Memory efficient |\n|------------------|------------------|\n| ZeRO-1           | ZeRO-3 + offload |\n| ZeRO-2           | ZeRO-3           |\n| ZeRO-2 + offload | ZeRO-2 + offload |\n| ZeRO-3           | ZeRO-2           |\n| ZeRO-3 + offload | ZeRO-1           |\n\nTo find what works best for you, start with the fastest approach and if you run out of memory, try the next stage which is slower but more memory efficient. Feel free to work in whichever direction you prefer (starting with the most memory efficient or fastest) to discover the appropriate balance between speed and memory usage.\n\nA general process you can use is (start with batch size of 1):\n\n1. enable gradient checkpointing\n2. try ZeRO-2\n3. try ZeRO-2 and offload the optimizer\n4. try ZeRO-3\n5. try ZeRO-3 and offload parameters to the CPU\n6. try ZeRO-3 and offload parameters and the optimizer to the CPU\n7. try lowering various default values like a narrower search beam if you're using the [`~GenerationMixin.generate`] method\n8. try mixed half-precision (fp16 on older GPU architectures and bf16 on Ampere) over full-precision weights\n9. add more hardware if possible or enable Infinity to offload parameters and the optimizer to a NVMe\n10. once you're not running out of memory, measure effective throughput and then try to increase the batch size as large as you can to maximize GPU efficiency\n11. lastly, try to optimize your training setup by disabling some offload features or use a faster ZeRO stage and increasing/decreasing the batch size to find the best tradeoff between speed and memory usage"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 49d8e529-8fbf-442d-8f18-7522df2ce534
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"49d8e529-8fbf-442d-8f18-7522df2ce534\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0a05eee3-763c-4f3b-aca8-c96d08ecec9a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"90629852709f297cbd0a8aed89b2f74e4d7969cadb9c74a6ff6873e794f5a83a\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"05bc3d91-2bf7-447c-873c-dbae135df00c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"57c662e2d5b645555a19baa75f67d852ec634028cd166a6c796b28d19e0a6a19\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4082, \"end_char_idx\": 7404, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "In order of fastest and most memory-efficient:\n\n| Fastest          | Memory efficient |\n|------------------|------------------|\n| ZeRO-1           | ZeRO-3 + offload |\n| ZeRO-2           | ZeRO-3           |\n| ZeRO-2 + offload | ZeRO-2 + offload |\n| ZeRO-3           | ZeRO-2           |\n| ZeRO-3 + offload | ZeRO-1           |\n\nTo find what works best for you, start with the fastest approach and if you run out of memory, try the next stage which is slower but more memory efficient. Feel free to work in whichever direction you prefer (starting with the most memory efficient or fastest) to discover the appropriate balance between speed and memory usage.\n\nA general process you can use is (start with batch size of 1):\n\n1. enable gradient checkpointing\n2. try ZeRO-2\n3. try ZeRO-2 and offload the optimizer\n4. try ZeRO-3\n5. try ZeRO-3 and offload parameters to the CPU\n6. try ZeRO-3 and offload parameters and the optimizer to the CPU\n7. try lowering various default values like a narrower search beam if you're using the [`~GenerationMixin.generate`] method\n8. try mixed half-precision (fp16 on older GPU architectures and bf16 on Ampere) over full-precision weights\n9. add more hardware if possible or enable Infinity to offload parameters and the optimizer to a NVMe\n10. once you're not running out of memory, measure effective throughput and then try to increase the batch size as large as you can to maximize GPU efficiency\n11. lastly, try to optimize your training setup by disabling some offload features or use a faster ZeRO stage and increasing/decreasing the batch size to find the best tradeoff between speed and memory usage\n\n\n## DeepSpeed configuration file\n\nDeepSpeed works with the [`Trainer`] class by way of a config file containing all the parameters for configuring how you want setup your training run. When you execute your training script, DeepSpeed logs the configuration it received from [`Trainer`] to the console so you can see exactly what configuration was used.\n\n<Tip>\n\nFind a complete list of DeepSpeed configuration options on the [DeepSpeed Configuration JSON](https://www.deepspeed.ai/docs/config-json/) reference. You can also find more practical examples of various DeepSpeed configuration examples on the [DeepSpeedExamples](https://github.com/microsoft/DeepSpeedExamples) repository or the main [DeepSpeed](https://github.com/microsoft/DeepSpeed) repository. To quickly find specific examples, you can:\n\n```bash\ngit clone https://github.com/microsoft/DeepSpeedExamples\ncd DeepSpeedExamples\nfind . -name '*json'\n# find examples with the Lamb optimizer\ngrep -i Lamb $(find . -name '*json')\n```\n\n</Tip>\n\nThe DeepSpeed configuration file is passed as a path to a JSON file if you're training from the command line interface or as a nested `dict` object if you're using the [`Trainer`] in a notebook setting.\n\n<hfoptions id=\"pass-config\">\n<hfoption id=\"path to file\">\n\n```py\nTrainingArguments(..., deepspeed=\"path/to/deepspeed_config.json\")\n```\n\n</hfoption>\n<hfoption id=\"nested dict\">\n\n```py\nds_config_dict = dict(scheduler=scheduler_params, optimizer=optimizer_params)\nargs = TrainingArguments(..., deepspeed=ds_config_dict)\ntrainer = Trainer(model, args, ...)\n```\n\n</hfoption>\n</hfoptions>\n\n### DeepSpeed and Trainer parameters\n\nThere are three types of configuration parameters:\n\n1."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 05bc3d91-2bf7-447c-873c-dbae135df00c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"05bc3d91-2bf7-447c-873c-dbae135df00c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"49d8e529-8fbf-442d-8f18-7522df2ce534\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"6ca4d0ae303ef0e2dda560f5089ba14f7745228a4a48a8ab94ff402980c92e8d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7339fa0f-2265-4406-b650-7532778867b4\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6a484ff399c53116700d6212e3896df029a3b4418281542312ec2188cd9fe06b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5725, \"end_char_idx\": 9333, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "## DeepSpeed configuration file\n\nDeepSpeed works with the [`Trainer`] class by way of a config file containing all the parameters for configuring how you want setup your training run. When you execute your training script, DeepSpeed logs the configuration it received from [`Trainer`] to the console so you can see exactly what configuration was used.\n\n<Tip>\n\nFind a complete list of DeepSpeed configuration options on the [DeepSpeed Configuration JSON](https://www.deepspeed.ai/docs/config-json/) reference. You can also find more practical examples of various DeepSpeed configuration examples on the [DeepSpeedExamples](https://github.com/microsoft/DeepSpeedExamples) repository or the main [DeepSpeed](https://github.com/microsoft/DeepSpeed) repository. To quickly find specific examples, you can:\n\n```bash\ngit clone https://github.com/microsoft/DeepSpeedExamples\ncd DeepSpeedExamples\nfind . -name '*json'\n# find examples with the Lamb optimizer\ngrep -i Lamb $(find . -name '*json')\n```\n\n</Tip>\n\nThe DeepSpeed configuration file is passed as a path to a JSON file if you're training from the command line interface or as a nested `dict` object if you're using the [`Trainer`] in a notebook setting.\n\n<hfoptions id=\"pass-config\">\n<hfoption id=\"path to file\">\n\n```py\nTrainingArguments(..., deepspeed=\"path/to/deepspeed_config.json\")\n```\n\n</hfoption>\n<hfoption id=\"nested dict\">\n\n```py\nds_config_dict = dict(scheduler=scheduler_params, optimizer=optimizer_params)\nargs = TrainingArguments(..., deepspeed=ds_config_dict)\ntrainer = Trainer(model, args, ...)\n```\n\n</hfoption>\n</hfoptions>\n\n### DeepSpeed and Trainer parameters\n\nThere are three types of configuration parameters:\n\n1. Some of the configuration parameters are shared by [`Trainer`] and DeepSpeed, and it can be difficult to identify errors when there are conflicting definitions. To make it easier, these shared configuration parameters are configured from the [`Trainer`] command line arguments.\n\n2. Some configuration parameters that are automatically derived from the model configuration so you don't need to manually adjust these values. The [`Trainer`] uses a configuration value `auto` to determine set the most correct or efficient value. You could set your own configuration parameters explicitly, but you must take care to ensure the [`Trainer`] arguments and DeepSpeed configuration parameters agree. Mismatches may cause the training to fail in very difficult to detect ways!\n\n3. Some configuration parameters specific to DeepSpeed only which need to be manually set based on your training needs.\n\nYou could also modify the DeepSpeed configuration and edit [`TrainingArguments`] from it:\n\n1. Create or load a DeepSpeed configuration to use as the main configuration\n2. Create a [`TrainingArguments`] object based on these DeepSpeed configuration values\n\nSome values, such as `scheduler.params.total_num_steps` are calculated by the [`Trainer`] during training.\n\n### ZeRO configuration\n\nThere are three configurations, each corresponding to a different ZeRO stage. Stage 1 is not as interesting for scalability, and this guide focuses on stages 2 and 3. The `zero_optimization` configuration contains all the options for what to enable and how to configure them. For a more detailed explanation of each parameter, take a look at the [DeepSpeed Configuration JSON](https://www.deepspeed.ai/docs/config-json/) reference.\n\n<Tip warning={true}>\nDeepSpeed doesn\u2019t validate parameter names and any typos fallback on the parameter's default setting. You can watch the DeepSpeed engine startup log messages to see what values it is going to use."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 7339fa0f-2265-4406-b650-7532778867b4
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"7339fa0f-2265-4406-b650-7532778867b4\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"05bc3d91-2bf7-447c-873c-dbae135df00c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"e739c4eb4f0c22280dfd5a4d30e815864797426704e21be4ee45741a2274357f\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7541adfc-381b-4b2b-a6d0-80ee8dcbe1c4\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"09dcc7ff68e9a762c1dc1aecd14cada7bd615151246ce5cb7319a6215f1b900e\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7405, \"end_char_idx\": 10946, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Some of the configuration parameters are shared by [`Trainer`] and DeepSpeed, and it can be difficult to identify errors when there are conflicting definitions. To make it easier, these shared configuration parameters are configured from the [`Trainer`] command line arguments.\n\n2. Some configuration parameters that are automatically derived from the model configuration so you don't need to manually adjust these values. The [`Trainer`] uses a configuration value `auto` to determine set the most correct or efficient value. You could set your own configuration parameters explicitly, but you must take care to ensure the [`Trainer`] arguments and DeepSpeed configuration parameters agree. Mismatches may cause the training to fail in very difficult to detect ways!\n\n3. Some configuration parameters specific to DeepSpeed only which need to be manually set based on your training needs.\n\nYou could also modify the DeepSpeed configuration and edit [`TrainingArguments`] from it:\n\n1. Create or load a DeepSpeed configuration to use as the main configuration\n2. Create a [`TrainingArguments`] object based on these DeepSpeed configuration values\n\nSome values, such as `scheduler.params.total_num_steps` are calculated by the [`Trainer`] during training.\n\n### ZeRO configuration\n\nThere are three configurations, each corresponding to a different ZeRO stage. Stage 1 is not as interesting for scalability, and this guide focuses on stages 2 and 3. The `zero_optimization` configuration contains all the options for what to enable and how to configure them. For a more detailed explanation of each parameter, take a look at the [DeepSpeed Configuration JSON](https://www.deepspeed.ai/docs/config-json/) reference.\n\n<Tip warning={true}>\nDeepSpeed doesn\u2019t validate parameter names and any typos fallback on the parameter's default setting. You can watch the DeepSpeed engine startup log messages to see what values it is going to use.\n\n</Tip>\n\nThe following configurations must be setup with DeepSpeed because the [`Trainer`] doesn't provide equivalent command line arguments.\n\n<hfoptions id=\"zero-config\">\n<hfoption id=\"ZeRO-1\">\n\nZeRO-1 shards the optimizer states across GPUs, and you can expect a tiny speed up. The ZeRO-1 config can be setup like this:\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 1\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"ZeRO-2\">\n\nZeRO-2 shards the optimizer and gradients across GPUs. This stage is primarily used for training since its features are not relevant to inference. Some important parameters to configure for better performance include:\n\n* `offload_optimizer` should be enabled to reduce GPU memory usage.\n* `overlap_comm` when set to `true` trades off increased GPU memory usage to lower allreduce latency. This feature uses 4.5x the `allgather_bucket_size` and `reduce_bucket_size` values. In this example, they're set to `5e8` which means it requires 9GB of GPU memory. If your GPU memory is 8GB or less, you should reduce `overlap_comm` to lower the memory requirements and prevent an out-of-memory (OOM) error.\n* `allgather_bucket_size` and `reduce_bucket_size` trade off available GPU memory for communication speed. The smaller their values, the slower communication is and the more GPU memory is available. You can balance, for example, whether a bigger batch size is more important than a slightly slower training time.\n* `round_robin_gradients` is available in DeepSpeed 0.4.4 for CPU offloading. It parallelizes gradient copying to CPU memory among ranks by fine-grained gradient partitioning."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 7541adfc-381b-4b2b-a6d0-80ee8dcbe1c4
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"7541adfc-381b-4b2b-a6d0-80ee8dcbe1c4\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"7339fa0f-2265-4406-b650-7532778867b4\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"6764a321140e85053a029f6dc3618cc864bab791e5fa49c16db4df2501b77e03\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d29e531a-e330-45db-b030-50092ce1e6f3\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e622bce42177675c9ae72b30ef5c8a69e52438001d9a446e785044d319815e6e\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9335, \"end_char_idx\": 12545, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "</Tip>\n\nThe following configurations must be setup with DeepSpeed because the [`Trainer`] doesn't provide equivalent command line arguments.\n\n<hfoptions id=\"zero-config\">\n<hfoption id=\"ZeRO-1\">\n\nZeRO-1 shards the optimizer states across GPUs, and you can expect a tiny speed up. The ZeRO-1 config can be setup like this:\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 1\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"ZeRO-2\">\n\nZeRO-2 shards the optimizer and gradients across GPUs. This stage is primarily used for training since its features are not relevant to inference. Some important parameters to configure for better performance include:\n\n* `offload_optimizer` should be enabled to reduce GPU memory usage.\n* `overlap_comm` when set to `true` trades off increased GPU memory usage to lower allreduce latency. This feature uses 4.5x the `allgather_bucket_size` and `reduce_bucket_size` values. In this example, they're set to `5e8` which means it requires 9GB of GPU memory. If your GPU memory is 8GB or less, you should reduce `overlap_comm` to lower the memory requirements and prevent an out-of-memory (OOM) error.\n* `allgather_bucket_size` and `reduce_bucket_size` trade off available GPU memory for communication speed. The smaller their values, the slower communication is and the more GPU memory is available. You can balance, for example, whether a bigger batch size is more important than a slightly slower training time.\n* `round_robin_gradients` is available in DeepSpeed 0.4.4 for CPU offloading. It parallelizes gradient copying to CPU memory among ranks by fine-grained gradient partitioning. Performance benefit grows with gradient accumulation steps (more copying between optimizer steps) or GPU count (increased parallelism).\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 2,\n        \"offload_optimizer\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"allgather_partitions\": true,\n        \"allgather_bucket_size\": 5e8,\n        \"overlap_comm\": true,\n        \"reduce_scatter\": true,\n        \"reduce_bucket_size\": 5e8,\n        \"contiguous_gradients\": true\n        \"round_robin_gradients\": true\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"ZeRO-3\">\n\nZeRO-3 shards the optimizer, gradient, and parameters across GPUs. Unlike ZeRO-2, ZeRO-3 can also be used for inference, in addition to training, because it allows large models to be loaded on multiple GPUs. Some important parameters to configure include:\n\n* `device: \"cpu\"` can help if you're running out of GPU memory and if you have free CPU memory available. This allows offloading model parameters to the CPU.\n* `pin_memory: true` can improve throughput, but less memory becomes available for other processes because the pinned memory is reserved for the specific process that requested it and it's typically accessed much faster than normal CPU memory.\n* `stage3_max_live_parameters` is the upper limit on how many full parameters you want to keep on the GPU at any given time. Reduce this value if you encounter an OOM error.\n* `stage3_max_reuse_distance` is a value for determining when a parameter is used again in the future, and it helps decide whether to throw the parameter away or to keep it."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: d29e531a-e330-45db-b030-50092ce1e6f3
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"d29e531a-e330-45db-b030-50092ce1e6f3\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"7541adfc-381b-4b2b-a6d0-80ee8dcbe1c4\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"c27551aa5dcc5030086f0692570a26076f145a8da423f5696ed02be7032fe34e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"24ac8af7-b836-4e25-bc87-6fe5e9573f9e\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"1fb4afe71567f903c105a1c70ed704cb3a5d504d30934b92f1179b12dc5d91c1\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10849, \"end_char_idx\": 14209, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "It parallelizes gradient copying to CPU memory among ranks by fine-grained gradient partitioning. Performance benefit grows with gradient accumulation steps (more copying between optimizer steps) or GPU count (increased parallelism).\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 2,\n        \"offload_optimizer\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"allgather_partitions\": true,\n        \"allgather_bucket_size\": 5e8,\n        \"overlap_comm\": true,\n        \"reduce_scatter\": true,\n        \"reduce_bucket_size\": 5e8,\n        \"contiguous_gradients\": true\n        \"round_robin_gradients\": true\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"ZeRO-3\">\n\nZeRO-3 shards the optimizer, gradient, and parameters across GPUs. Unlike ZeRO-2, ZeRO-3 can also be used for inference, in addition to training, because it allows large models to be loaded on multiple GPUs. Some important parameters to configure include:\n\n* `device: \"cpu\"` can help if you're running out of GPU memory and if you have free CPU memory available. This allows offloading model parameters to the CPU.\n* `pin_memory: true` can improve throughput, but less memory becomes available for other processes because the pinned memory is reserved for the specific process that requested it and it's typically accessed much faster than normal CPU memory.\n* `stage3_max_live_parameters` is the upper limit on how many full parameters you want to keep on the GPU at any given time. Reduce this value if you encounter an OOM error.\n* `stage3_max_reuse_distance` is a value for determining when a parameter is used again in the future, and it helps decide whether to throw the parameter away or to keep it. If the parameter is going to be reused (if the value is less than `stage3_max_reuse_distance`), then it is kept to reduce communication overhead. This is super helpful when activation checkpointing is enabled and you want to keep the parameter in the forward recompute until the backward pass. But reduce this value if you encounter an OOM error.\n* `stage3_gather_16bit_weights_on_model_save` consolidates fp16 weights when a model is saved. For large models and multiple GPUs, this is expensive in terms of memory and speed. You should enable it if you're planning on resuming training.\n* `sub_group_size` controls which parameters are updated during the optimizer step. Parameters are grouped into buckets of `sub_group_size` and each bucket is updated one at a time. When used with NVMe offload, `sub_group_size` determines when model states are moved in and out of CPU memory from during the optimization step. This prevents running out of CPU memory for extremely large models. `sub_group_size` can be left to its default value if you aren't using NVMe offload, but you may want to change it if you:\n\n    1. Run into an OOM error during the optimizer step. In this case, reduce `sub_group_size` to reduce memory usage of the temporary buffers.\n    2. The optimizer step is taking a really long time. In this case, increase `sub_group_size` to improve bandwidth utilization as a result of increased data buffers.\n\n* `reduce_bucket_size`, `stage3_prefetch_bucket_size`, and `stage3_param_persistence_threshold` are dependent on a model's hidden size. It is recommended to set these values to `auto` and allow the [`Trainer`] to automatically assign the values."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 24ac8af7-b836-4e25-bc87-6fe5e9573f9e
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"24ac8af7-b836-4e25-bc87-6fe5e9573f9e\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d29e531a-e330-45db-b030-50092ce1e6f3\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"40f9c95409c9c7bcd33c26916522ffe38891ec0223f57625f60553ece1e129d7\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"548af367-885c-4295-89d2-67dce1db5938\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4cecf0cf090bf952d33b283043aaeb74f4e5134be7d21b202cfb1b35592e6e66\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12546, \"end_char_idx\": 15535, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "If the parameter is going to be reused (if the value is less than `stage3_max_reuse_distance`), then it is kept to reduce communication overhead. This is super helpful when activation checkpointing is enabled and you want to keep the parameter in the forward recompute until the backward pass. But reduce this value if you encounter an OOM error.\n* `stage3_gather_16bit_weights_on_model_save` consolidates fp16 weights when a model is saved. For large models and multiple GPUs, this is expensive in terms of memory and speed. You should enable it if you're planning on resuming training.\n* `sub_group_size` controls which parameters are updated during the optimizer step. Parameters are grouped into buckets of `sub_group_size` and each bucket is updated one at a time. When used with NVMe offload, `sub_group_size` determines when model states are moved in and out of CPU memory from during the optimization step. This prevents running out of CPU memory for extremely large models. `sub_group_size` can be left to its default value if you aren't using NVMe offload, but you may want to change it if you:\n\n    1. Run into an OOM error during the optimizer step. In this case, reduce `sub_group_size` to reduce memory usage of the temporary buffers.\n    2. The optimizer step is taking a really long time. In this case, increase `sub_group_size` to improve bandwidth utilization as a result of increased data buffers.\n\n* `reduce_bucket_size`, `stage3_prefetch_bucket_size`, and `stage3_param_persistence_threshold` are dependent on a model's hidden size. It is recommended to set these values to `auto` and allow the [`Trainer`] to automatically assign the values.\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_optimizer\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"offload_param\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"overlap_comm\": true,\n        \"contiguous_gradients\": true,\n        \"sub_group_size\": 1e9,\n        \"reduce_bucket_size\": \"auto\",\n        \"stage3_prefetch_bucket_size\": \"auto\",\n        \"stage3_param_persistence_threshold\": \"auto\",\n        \"stage3_max_live_parameters\": 1e9,\n        \"stage3_max_reuse_distance\": 1e9,\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    }\n}\n```\n\nYou can use the [`deepspeed.zero.Init`](https://deepspeed.readthedocs.io/en/latest/zero3.html#deepspeed.zero.Init) context manager to initialize a model faster:\n\n```py\nfrom transformers import T5ForConditionalGeneration, T5Config\nimport deepspeed\n\nwith deepspeed.zero.Init():\n    config = T5Config.from_pretrained(\"google-t5/t5-small\")\n    model = T5ForConditionalGeneration(config)\n```\n\nFor pretrained models, the DeepSped config file needs to have `is_deepspeed_zero3_enabled: true` setup in [`TrainingArguments`] and it needs a ZeRO configuration enabled. The [`TrainingArguments`] object must be created **before** calling the model [`~PreTrainedModel.from_pretrained`]."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 548af367-885c-4295-89d2-67dce1db5938
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"548af367-885c-4295-89d2-67dce1db5938\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"24ac8af7-b836-4e25-bc87-6fe5e9573f9e\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9bc21fcaf586badc8cde3d6fee053814b8e3bd22dcdd0ab1645b6daa6f15369d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b804e41c-c024-415e-a237-d023e8522938\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"25f10ff421ad9688a69ac27af21316983380f40eee7aa361b57494631fa64da0\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13964, \"end_char_idx\": 17184, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "* `reduce_bucket_size`, `stage3_prefetch_bucket_size`, and `stage3_param_persistence_threshold` are dependent on a model's hidden size. It is recommended to set these values to `auto` and allow the [`Trainer`] to automatically assign the values.\n\n```yml\n{\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_optimizer\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"offload_param\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"overlap_comm\": true,\n        \"contiguous_gradients\": true,\n        \"sub_group_size\": 1e9,\n        \"reduce_bucket_size\": \"auto\",\n        \"stage3_prefetch_bucket_size\": \"auto\",\n        \"stage3_param_persistence_threshold\": \"auto\",\n        \"stage3_max_live_parameters\": 1e9,\n        \"stage3_max_reuse_distance\": 1e9,\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    }\n}\n```\n\nYou can use the [`deepspeed.zero.Init`](https://deepspeed.readthedocs.io/en/latest/zero3.html#deepspeed.zero.Init) context manager to initialize a model faster:\n\n```py\nfrom transformers import T5ForConditionalGeneration, T5Config\nimport deepspeed\n\nwith deepspeed.zero.Init():\n    config = T5Config.from_pretrained(\"google-t5/t5-small\")\n    model = T5ForConditionalGeneration(config)\n```\n\nFor pretrained models, the DeepSped config file needs to have `is_deepspeed_zero3_enabled: true` setup in [`TrainingArguments`] and it needs a ZeRO configuration enabled. The [`TrainingArguments`] object must be created **before** calling the model [`~PreTrainedModel.from_pretrained`].\n\n```py\nfrom transformers import AutoModel, Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(..., deepspeed=ds_config)\nmodel = AutoModel.from_pretrained(\"google-t5/t5-small\")\ntrainer = Trainer(model=model, args=training_args, ...)\n```\n\nYou'll need ZeRO-3 if the fp16 weights don't fit on a single GPU. If you're able to load fp16 weights, then make sure you specify `torch_dtype=torch.float16` in [`~PreTrainedModel.from_pretrained`].\n\nAnother consideration for ZeRO-3 is if you have multiple GPUs, no single GPU has all the parameters unless it's the parameters for the currently executing layer. To access all parameters from all the layers at once, such as loading pretrained model weights in [`~PreTrainedModel.from_pretrained`], one layer is loaded at a time and immediately partitioned to all GPUs. This is because for very large models, it isn't possible to load the weights on one GPU and then distribute them across the other GPUs due to memory limitations.\n\nIf you encounter a model parameter weight that looks like the following, where `tensor([1.])` or the parameter size is 1 instead of a larger multi-dimensional shape, this means the parameter is partitioned and this is a ZeRO-3 placeholder.\n\n```py\ntensor([1.0], device=\"cuda:0\", dtype=torch.float16, requires_grad=True)\n```\n\n<Tip>\n\nFor more information about initializing large models with ZeRO-3 and accessing the parameters, take a look at the [Constructing Massive Models](https://deepspeed.readthedocs.io/en/latest/zero3.html#constructing-massive-models) and [Gathering Parameters](https://deepspeed.readthedocs.io/en/latest/zero3.html#gathering-parameters) guides."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: b804e41c-c024-415e-a237-d023e8522938
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"b804e41c-c024-415e-a237-d023e8522938\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"548af367-885c-4295-89d2-67dce1db5938\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"2beb106c23bd018843c574be1d457c6080a8e330c49d016c108f76e6d1b129f5\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d4b78d2f-9e69-4c89-bedc-f48627bd9d76\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"bae6a1593270c09387577b7670ea77ab58a0fb31389f96de838864646d942c9a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 15537, \"end_char_idx\": 18485, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "```py\nfrom transformers import AutoModel, Trainer, TrainingArguments\n\ntraining_args = TrainingArguments(..., deepspeed=ds_config)\nmodel = AutoModel.from_pretrained(\"google-t5/t5-small\")\ntrainer = Trainer(model=model, args=training_args, ...)\n```\n\nYou'll need ZeRO-3 if the fp16 weights don't fit on a single GPU. If you're able to load fp16 weights, then make sure you specify `torch_dtype=torch.float16` in [`~PreTrainedModel.from_pretrained`].\n\nAnother consideration for ZeRO-3 is if you have multiple GPUs, no single GPU has all the parameters unless it's the parameters for the currently executing layer. To access all parameters from all the layers at once, such as loading pretrained model weights in [`~PreTrainedModel.from_pretrained`], one layer is loaded at a time and immediately partitioned to all GPUs. This is because for very large models, it isn't possible to load the weights on one GPU and then distribute them across the other GPUs due to memory limitations.\n\nIf you encounter a model parameter weight that looks like the following, where `tensor([1.])` or the parameter size is 1 instead of a larger multi-dimensional shape, this means the parameter is partitioned and this is a ZeRO-3 placeholder.\n\n```py\ntensor([1.0], device=\"cuda:0\", dtype=torch.float16, requires_grad=True)\n```\n\n<Tip>\n\nFor more information about initializing large models with ZeRO-3 and accessing the parameters, take a look at the [Constructing Massive Models](https://deepspeed.readthedocs.io/en/latest/zero3.html#constructing-massive-models) and [Gathering Parameters](https://deepspeed.readthedocs.io/en/latest/zero3.html#gathering-parameters) guides.\n\n</Tip>\n\n</hfoption>\n</hfoptions>\n\n### NVMe configuration\n\n[ZeRO-Infinity](https://hf.co/papers/2104.07857) allows offloading model states to the CPU and/or NVMe to save even more memory. Smart partitioning and tiling algorithms allow each GPU to send and receive very small amounts of data during offloading such that a modern NVMe can fit an even larger total memory pool than is available to your training process. ZeRO-Infinity requires ZeRO-3.\n\nDepending on the CPU and/or NVMe memory available, you can offload both the [optimizer states](https://www.deepspeed.ai/docs/config-json/#optimizer-offloading) and [parameters](https://www.deepspeed.ai/docs/config-json/#parameter-offloading), just one of them, or none. You should also make sure the `nvme_path` is pointing to an NVMe device, because while it still works with a normal hard drive or solid state drive, it'll be significantly slower. With a modern NVMe, you can expect peak transfer speeds of ~3.5GB/s for read and ~3GB/s for write operations. Lastly, [run a benchmark](https://github.com/microsoft/DeepSpeed/issues/998) on your training setup to determine the optimal `aio` configuration.\n\nThe example ZeRO-3/Infinity configuration file below sets most of the parameter values to `auto`, but you could also manually add these values."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: d4b78d2f-9e69-4c89-bedc-f48627bd9d76
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"d4b78d2f-9e69-4c89-bedc-f48627bd9d76\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b804e41c-c024-415e-a237-d023e8522938\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f5b32c4ee622bfdd02689dfb0fa3dd18dfd12c597d133bea3fce4630f197d719\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f4b0412c-2b3d-49fc-a9e8-7e757906fe88\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"d0ad19e32536166afaaebb7c0efb03d77c88bb33534ba2ee2707a5f15ba7b325\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 17186, \"end_char_idx\": 20541, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "</Tip>\n\n</hfoption>\n</hfoptions>\n\n### NVMe configuration\n\n[ZeRO-Infinity](https://hf.co/papers/2104.07857) allows offloading model states to the CPU and/or NVMe to save even more memory. Smart partitioning and tiling algorithms allow each GPU to send and receive very small amounts of data during offloading such that a modern NVMe can fit an even larger total memory pool than is available to your training process. ZeRO-Infinity requires ZeRO-3.\n\nDepending on the CPU and/or NVMe memory available, you can offload both the [optimizer states](https://www.deepspeed.ai/docs/config-json/#optimizer-offloading) and [parameters](https://www.deepspeed.ai/docs/config-json/#parameter-offloading), just one of them, or none. You should also make sure the `nvme_path` is pointing to an NVMe device, because while it still works with a normal hard drive or solid state drive, it'll be significantly slower. With a modern NVMe, you can expect peak transfer speeds of ~3.5GB/s for read and ~3GB/s for write operations. Lastly, [run a benchmark](https://github.com/microsoft/DeepSpeed/issues/998) on your training setup to determine the optimal `aio` configuration.\n\nThe example ZeRO-3/Infinity configuration file below sets most of the parameter values to `auto`, but you could also manually add these values.\n\n```yml\n{\n    \"fp16\": {\n        \"enabled\": \"auto\",\n        \"loss_scale\": 0,\n        \"loss_scale_window\": 1000,\n        \"initial_scale_power\": 16,\n        \"hysteresis\": 2,\n        \"min_loss_scale\": 1\n    },\n\n    \"optimizer\": {\n        \"type\": \"AdamW\",\n        \"params\": {\n            \"lr\": \"auto\",\n            \"betas\": \"auto\",\n            \"eps\": \"auto\",\n            \"weight_decay\": \"auto\"\n        }\n    },\n\n    \"scheduler\": {\n        \"type\": \"WarmupLR\",\n        \"params\": {\n            \"warmup_min_lr\": \"auto\",\n            \"warmup_max_lr\": \"auto\",\n            \"warmup_num_steps\": \"auto\"\n        }\n    },\n\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_optimizer\": {\n            \"device\": \"nvme\",\n            \"nvme_path\": \"/local_nvme\",\n            \"pin_memory\": true,\n            \"buffer_count\": 4,\n            \"fast_init\": false\n        },\n        \"offload_param\": {\n            \"device\": \"nvme\",\n            \"nvme_path\": \"/local_nvme\",\n            \"pin_memory\": true,\n            \"buffer_count\": 5,\n            \"buffer_size\": 1e8,\n            \"max_in_cpu\": 1e9\n        },\n        \"aio\": {\n            \"block_size\": 262144,\n            \"queue_depth\": 32,\n            \"thread_count\": 1,\n            \"single_submit\": false,\n            \"overlap_events\": true\n        },\n        \"overlap_comm\": true,\n        \"contiguous_gradients\": true,\n        \"sub_group_size\": 1e9,\n        \"reduce_bucket_size\": \"auto\",\n        \"stage3_prefetch_bucket_size\": \"auto\",\n        \"stage3_param_persistence_threshold\": \"auto\",\n        \"stage3_max_live_parameters\": 1e9,\n        \"stage3_max_reuse_distance\": 1e9,\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    },\n\n    \"gradient_accumulation_steps\": \"auto\",\n    \"gradient_clipping\": \"auto\",\n    \"steps_per_print\": 2000,\n    \"train_batch_size\": \"auto\",\n    \"train_micro_batch_size_per_gpu\": \"auto\",\n    \"wall_clock_breakdown\": false\n}\n```\n\n## DeepSpeed features\n\nThere are a number of important parameters to specify in the DeepSpeed configuration file which are briefly described in this section."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: f4b0412c-2b3d-49fc-a9e8-7e757906fe88
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"f4b0412c-2b3d-49fc-a9e8-7e757906fe88\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d4b78d2f-9e69-4c89-bedc-f48627bd9d76\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"db90bc862d291aaef1e368e2cb47f7860414a0f5a2eb5ea5683a3c8353f3061e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d74b81b4-022a-45e3-b16c-258fbcc75cda\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f61da2562c3fc580e05e27938d999e344cfb0e3768042539cf5b106e62452d0a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 20543, \"end_char_idx\": 23457, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "### Activation/gradient checkpointing\n\nActivation and gradient checkpointing trades speed for more GPU memory which allows you to overcome scenarios where your GPU is out of memory or to increase your batch size for better performance. To enable this feature:\n\n1. For a Hugging Face model, set `model.gradient_checkpointing_enable()` or `--gradient_checkpointing` in the [`Trainer`].\n2. For a non-Hugging Face model, use the DeepSpeed [Activation Checkpointing API](https://deepspeed.readthedocs.io/en/latest/activation-checkpointing.html). You could also replace the Transformers modeling code and replace `torch.utils.checkpoint` with the DeepSpeed API. This approach is more flexible because you can offload the forward activations to the CPU memory instead of recalculating them.\n\n### Optimizer and scheduler\n\nDeepSpeed and Transformers optimizer and scheduler can be mixed and matched as long as you don't enable `offload_optimizer`. When `offload_optimizer` is enabled, you could use a non-DeepSpeed optimizer (except for LAMB) as long as it has both a CPU and GPU implementation.\n\n<Tip warning={true}>\n\nThe optimizer and scheduler parameters for the config file can be set from the command line to avoid hard to find errors. For example, if the learning rate is set to a different value in another place you can override it from the command line. Aside from the optimizer and scheduler parameters, you'll need to ensure your [`Trainer`] command line arguments match the DeepSpeed configuration.\n\n</Tip>\n\n<hfoptions id=\"opt-sched\">\n<hfoption id=\"optimizer\">\n\nDeepSpeed offers several [optimizers](https://www.deepspeed.ai/docs/config-json/#optimizer-parameters) (Adam, AdamW, OneBitAdam, and LAMB) but you can also import other optimizers from PyTorch. If you don't configure the optimizer in the config, the [`Trainer`] automatically selects AdamW and either uses the supplied values or the default values for the following parameters from the command line: `lr`, `adam_beta1`, `adam_beta2`, `adam_epsilon`, `weight_decay`.\n\nYou can set the parameters to `\"auto\"` or manually input your own desired values.\n\n```yaml\n{\n   \"optimizer\": {\n       \"type\": \"AdamW\",\n       \"params\": {\n         \"lr\": \"auto\",\n         \"betas\": \"auto\",\n         \"eps\": \"auto\",\n         \"weight_decay\": \"auto\"\n       }\n   }\n}\n```\n\nYou can also use an unsupported optimizer by adding the following to the top level configuration.\n\n```yaml\n{\n   \"zero_allow_untested_optimizer\": true\n}\n```\n\nFrom DeepSpeed==0.8.3 on, if you want to use offload, you'll also need to the following to the top level configuration because offload works best with DeepSpeed's CPU Adam optimizer.\n\n```yaml\n{\n   \"zero_force_ds_cpu_optimizer\": false\n}\n```\n\n</hfoption>\n<hfoption id=\"scheduler\">\n\nDeepSpeed supports the LRRangeTest, OneCycle, WarmupLR and WarmupDecayLR learning rate [schedulers](https://www.deepspeed.ai/docs/config-json/#scheduler-parameters)."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: d74b81b4-022a-45e3-b16c-258fbcc75cda
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"d74b81b4-022a-45e3-b16c-258fbcc75cda\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f4b0412c-2b3d-49fc-a9e8-7e757906fe88\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"b559fbb0956f81a9a96432ddf855e22564d522b3fc2b005e0e1d53f8d49a6bf6\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"df85f57c-4ac2-47e4-9cb2-18ce1ac6235a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6157b46c7ac0d7a4fb4c6baf996d039d338e36630066789becda8eb83bd070b6\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 21897, \"end_char_idx\": 24877, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Aside from the optimizer and scheduler parameters, you'll need to ensure your [`Trainer`] command line arguments match the DeepSpeed configuration.\n\n</Tip>\n\n<hfoptions id=\"opt-sched\">\n<hfoption id=\"optimizer\">\n\nDeepSpeed offers several [optimizers](https://www.deepspeed.ai/docs/config-json/#optimizer-parameters) (Adam, AdamW, OneBitAdam, and LAMB) but you can also import other optimizers from PyTorch. If you don't configure the optimizer in the config, the [`Trainer`] automatically selects AdamW and either uses the supplied values or the default values for the following parameters from the command line: `lr`, `adam_beta1`, `adam_beta2`, `adam_epsilon`, `weight_decay`.\n\nYou can set the parameters to `\"auto\"` or manually input your own desired values.\n\n```yaml\n{\n   \"optimizer\": {\n       \"type\": \"AdamW\",\n       \"params\": {\n         \"lr\": \"auto\",\n         \"betas\": \"auto\",\n         \"eps\": \"auto\",\n         \"weight_decay\": \"auto\"\n       }\n   }\n}\n```\n\nYou can also use an unsupported optimizer by adding the following to the top level configuration.\n\n```yaml\n{\n   \"zero_allow_untested_optimizer\": true\n}\n```\n\nFrom DeepSpeed==0.8.3 on, if you want to use offload, you'll also need to the following to the top level configuration because offload works best with DeepSpeed's CPU Adam optimizer.\n\n```yaml\n{\n   \"zero_force_ds_cpu_optimizer\": false\n}\n```\n\n</hfoption>\n<hfoption id=\"scheduler\">\n\nDeepSpeed supports the LRRangeTest, OneCycle, WarmupLR and WarmupDecayLR learning rate [schedulers](https://www.deepspeed.ai/docs/config-json/#scheduler-parameters).\n\nTransformers and DeepSpeed provide two of the same schedulers:\n\n* WarmupLR is the same as `--lr_scheduler_type constant_with_warmup` in Transformers\n* WarmupDecayLR is the same as  `--lr_scheduler_type linear` in Transformers (this is the default scheduler used in Transformers)\n\nIf you don't configure the scheduler in the config, the [`Trainer`] automatically selects WarmupDecayLR and either uses the supplied values or the default values for the following parameters from the command line: `warmup_min_lr`, `warmup_max_lr`, `warmup_num_steps`, `total_num_steps` (automatically calculated during run time if `max_steps` is not provided).\n\nYou can set the parameters to `\"auto\"` or manually input your own desired values.\n\n```yaml\n{\n   \"scheduler\": {\n         \"type\": \"WarmupDecayLR\",\n         \"params\": {\n             \"total_num_steps\": \"auto\",\n             \"warmup_min_lr\": \"auto\",\n             \"warmup_max_lr\": \"auto\",\n             \"warmup_num_steps\": \"auto\"\n         }\n     }\n}\n```\n\n</hfoption>\n</hfoptions>\n\n### Precision\n\nDeepspeed supports fp32, fp16, and bf16 mixed precision.\n\n<hfoptions id=\"precision\">\n<hfoption id=\"fp32\">\n\nIf your model doesn't work well with mixed precision, for example if it wasn't pretrained in mixed precision, you may encounter overflow or underflow issues which can cause NaN loss. For these cases, you should use full fp32 precision by explicitly disabling the default fp16 mode."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: df85f57c-4ac2-47e4-9cb2-18ce1ac6235a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"df85f57c-4ac2-47e4-9cb2-18ce1ac6235a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d74b81b4-022a-45e3-b16c-258fbcc75cda\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"528a356e6774632f97776f9ceff43d3513e2a6593b7bf6725dd195e2e85a8c88\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"6508cefa-bb21-4ae6-b36d-5158c5b6c562\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"52a70a2b2daf4af82290a537120db619cd73c142ccf1b14b8aad6461254731c5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 23459, \"end_char_idx\": 26459, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Transformers and DeepSpeed provide two of the same schedulers:\n\n* WarmupLR is the same as `--lr_scheduler_type constant_with_warmup` in Transformers\n* WarmupDecayLR is the same as  `--lr_scheduler_type linear` in Transformers (this is the default scheduler used in Transformers)\n\nIf you don't configure the scheduler in the config, the [`Trainer`] automatically selects WarmupDecayLR and either uses the supplied values or the default values for the following parameters from the command line: `warmup_min_lr`, `warmup_max_lr`, `warmup_num_steps`, `total_num_steps` (automatically calculated during run time if `max_steps` is not provided).\n\nYou can set the parameters to `\"auto\"` or manually input your own desired values.\n\n```yaml\n{\n   \"scheduler\": {\n         \"type\": \"WarmupDecayLR\",\n         \"params\": {\n             \"total_num_steps\": \"auto\",\n             \"warmup_min_lr\": \"auto\",\n             \"warmup_max_lr\": \"auto\",\n             \"warmup_num_steps\": \"auto\"\n         }\n     }\n}\n```\n\n</hfoption>\n</hfoptions>\n\n### Precision\n\nDeepspeed supports fp32, fp16, and bf16 mixed precision.\n\n<hfoptions id=\"precision\">\n<hfoption id=\"fp32\">\n\nIf your model doesn't work well with mixed precision, for example if it wasn't pretrained in mixed precision, you may encounter overflow or underflow issues which can cause NaN loss. For these cases, you should use full fp32 precision by explicitly disabling the default fp16 mode.\n\n```yaml\n{\n    \"fp16\": {\n        \"enabled\": false\n    }\n}\n```\n\nFor Ampere GPUs and PyTorch > 1.7, it automatically switches to the more efficient [tf32](https://pytorch.org/docs/stable/notes/cuda.html#tensorfloat-32-tf32-on-ampere-devices) format for some operations but the results are still in fp32. You can control it from the [`Trainer`] by setting `--tf32` to enable it, and `--tf32 0` or `--no_tf32` to disable it.\n\n</hfoption>\n<hfoption id=\"fp16\">\n\nTo configure PyTorch AMP-like fp16 mixed precision reduces memory usage and accelerates training speed. [`Trainer`] automatically enables or disables fp16 based on the value of `args.fp16_backend`, and the rest of the config can be set by you. fp16 is enabled from the command line when the following arguments are passed: `--fp16`, `--fp16_backend amp` or `--fp16_full_eval`.\n\n```yaml\n{\n    \"fp16\": {\n        \"enabled\": \"auto\",\n        \"loss_scale\": 0,\n        \"loss_scale_window\": 1000,\n        \"initial_scale_power\": 16,\n        \"hysteresis\": 2,\n        \"min_loss_scale\": 1\n    }\n}\n```\n\nFor additional DeepSpeed fp16 training options, take a look at the [FP16 Training Options](https://www.deepspeed.ai/docs/config-json/#fp16-training-options) reference.\n\nTo configure Apex-like fp16 mixed precision, setup the config as shown below with `\"auto\"` or your own values. [`Trainer`] automatically configure `amp` based on the values of `args.fp16_backend` and `args.fp16_opt_level`. It can also be enabled from the command line when the following arguments are passed: `--fp16`, `--fp16_backend apex` or `--fp16_opt_level 01`."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 6508cefa-bb21-4ae6-b36d-5158c5b6c562
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"6508cefa-bb21-4ae6-b36d-5158c5b6c562\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"df85f57c-4ac2-47e4-9cb2-18ce1ac6235a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"1fb0aa5a6526058b32782a2685989b7a0a6b9c9d82bd15ee8a6fd2711466e177\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0c432cd6-1c7a-4c95-b4af-487a3e47df03\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"00d03e2729c3b10f3482d59bccd16eec56cbeece104fad2ed83a5d018a6821b5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 25180, \"end_char_idx\": 28218, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "You can control it from the [`Trainer`] by setting `--tf32` to enable it, and `--tf32 0` or `--no_tf32` to disable it.\n\n</hfoption>\n<hfoption id=\"fp16\">\n\nTo configure PyTorch AMP-like fp16 mixed precision reduces memory usage and accelerates training speed. [`Trainer`] automatically enables or disables fp16 based on the value of `args.fp16_backend`, and the rest of the config can be set by you. fp16 is enabled from the command line when the following arguments are passed: `--fp16`, `--fp16_backend amp` or `--fp16_full_eval`.\n\n```yaml\n{\n    \"fp16\": {\n        \"enabled\": \"auto\",\n        \"loss_scale\": 0,\n        \"loss_scale_window\": 1000,\n        \"initial_scale_power\": 16,\n        \"hysteresis\": 2,\n        \"min_loss_scale\": 1\n    }\n}\n```\n\nFor additional DeepSpeed fp16 training options, take a look at the [FP16 Training Options](https://www.deepspeed.ai/docs/config-json/#fp16-training-options) reference.\n\nTo configure Apex-like fp16 mixed precision, setup the config as shown below with `\"auto\"` or your own values. [`Trainer`] automatically configure `amp` based on the values of `args.fp16_backend` and `args.fp16_opt_level`. It can also be enabled from the command line when the following arguments are passed: `--fp16`, `--fp16_backend apex` or `--fp16_opt_level 01`.\n\n```yaml\n{\n    \"amp\": {\n        \"enabled\": \"auto\",\n        \"opt_level\": \"auto\"\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"bf16\">\n\nTo use bf16, you'll need at least DeepSpeed==0.6.0. bf16 has the same dynamic range as fp32 and doesn\u2019t require loss scaling. However, if you use [gradient accumulation](#gradient-accumulation) with bf16, gradients are accumulated in bf16 which may not be desired because this format's low precision can lead to lossy accumulation.\n\nbf16 can be setup in the config file or enabled from the command line when the following arguments are passed: `--bf16` or `--bf16_full_eval`.\n\n```yaml\n{\n    \"bf16\": {\n        \"enabled\": \"auto\"\n    }\n}\n```\n\n</hfoption>\n</hfoptions>\n\n### Batch size\n\nThe batch size can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets `train_micro_batch_size_per_gpu` to the value of args.`per_device_train_batch_size` and `train_batch_size` to `args.world_size * args.per_device_train_batch_size * args.gradient_accumulation_steps`.\n\n```yaml\n{\n    \"train_micro_batch_size_per_gpu\": \"auto\",\n    \"train_batch_size\": \"auto\"\n}\n```\n\n### Gradient accumulation\n\nGradient accumulation can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets it to the value of `args.gradient_accumulation_steps`.\n\n```yaml\n{\n    \"gradient_accumulation_steps\": \"auto\"\n}\n\n```\n\n### Gradient clipping\n\nGradient clipping can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets it to the value of `args.max_grad_norm`.\n\n```yaml\n{\n    \"gradient_clipping\": \"auto\"\n}\n```\n\n### Communication data type\n\nFor communication collectives like reduction, gathering and scattering operations, a separate data type is used."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 0c432cd6-1c7a-4c95-b4af-487a3e47df03
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"0c432cd6-1c7a-4c95-b4af-487a3e47df03\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"6508cefa-bb21-4ae6-b36d-5158c5b6c562\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"8bea0ff72130c30c82329843101e053dd3e7c67f0a475a30431f668b733cc4e3\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5ca9aa9a-a5e4-45ac-87ee-17d695264654\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ee5ca824608638ebfc9b08113de83051a2fe34d9c4b6ef203cd30619184d2f5c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 26638, \"end_char_idx\": 29889, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "bf16 has the same dynamic range as fp32 and doesn\u2019t require loss scaling. However, if you use [gradient accumulation](#gradient-accumulation) with bf16, gradients are accumulated in bf16 which may not be desired because this format's low precision can lead to lossy accumulation.\n\nbf16 can be setup in the config file or enabled from the command line when the following arguments are passed: `--bf16` or `--bf16_full_eval`.\n\n```yaml\n{\n    \"bf16\": {\n        \"enabled\": \"auto\"\n    }\n}\n```\n\n</hfoption>\n</hfoptions>\n\n### Batch size\n\nThe batch size can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets `train_micro_batch_size_per_gpu` to the value of args.`per_device_train_batch_size` and `train_batch_size` to `args.world_size * args.per_device_train_batch_size * args.gradient_accumulation_steps`.\n\n```yaml\n{\n    \"train_micro_batch_size_per_gpu\": \"auto\",\n    \"train_batch_size\": \"auto\"\n}\n```\n\n### Gradient accumulation\n\nGradient accumulation can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets it to the value of `args.gradient_accumulation_steps`.\n\n```yaml\n{\n    \"gradient_accumulation_steps\": \"auto\"\n}\n\n```\n\n### Gradient clipping\n\nGradient clipping can be auto-configured or explicitly set. If you choose to use the `\"auto\"` option, [`Trainer`] sets it to the value of `args.max_grad_norm`.\n\n```yaml\n{\n    \"gradient_clipping\": \"auto\"\n}\n```\n\n### Communication data type\n\nFor communication collectives like reduction, gathering and scattering operations, a separate data type is used.\n\nAll gather and scatter operations are performed in the same data type the data is in. For example, if you're training with bf16, the data is also gathered in bf16 because gathering is a non-lossy operation.\n\nReduce operations are lossy, for example when gradients are averaged across multiple GPUs. When the communication is done in fp16 or bf16, it is more likely to be lossy because adding multiple numbers in low precision isn't exact. This is especially the case with bf16 which has a lower precision than fp16. For this reason, fp16 is the default for reduction operations because the loss is minimal when averaging gradients.\n\nYou can choose the communication data type by setting the `communication_data_type` parameter in the config file. For example, choosing fp32 adds a small amount of overhead but ensures the reduction operation is accumulated in fp32 and when it is ready, it is downcasted to whichever half-precision dtype you're training in.\n\n```yaml\n{\n    \"communication_data_type\": \"fp32\"\n}\n```\n\n## Deployment\n\nDeepSpeed can be deployed by different launchers such as [torchrun](https://pytorch.org/docs/stable/elastic/run.html), the `deepspeed` launcher, or [Accelerate](https://huggingface.co/docs/accelerate/basic_tutorials/launch#using-accelerate-launch). To deploy, add `--deepspeed ds_config.json` to the [`Trainer`] command line. It\u2019s recommended to use DeepSpeed\u2019s [`add_config_arguments`](https://deepspeed.readthedocs.io/en/latest/initialize.html#argument-parsing) utility to add any necessary command line arguments to your code.\n\nThis guide will show you how to deploy DeepSpeed with the `deepspeed` launcher for different training setups."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 5ca9aa9a-a5e4-45ac-87ee-17d695264654
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"5ca9aa9a-a5e4-45ac-87ee-17d695264654\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0c432cd6-1c7a-4c95-b4af-487a3e47df03\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"6f47fa40ac9be48b8a39348cde637bdbb02bd06b21b3e2eb161d6698769a589c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"63d11a03-12b4-45f2-a6ba-21234995f7c5\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b5ddc7f78eac095e2e047f5704896e9394510728b35efb14e9141b850a54fe8d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 28220, \"end_char_idx\": 31385, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "All gather and scatter operations are performed in the same data type the data is in. For example, if you're training with bf16, the data is also gathered in bf16 because gathering is a non-lossy operation.\n\nReduce operations are lossy, for example when gradients are averaged across multiple GPUs. When the communication is done in fp16 or bf16, it is more likely to be lossy because adding multiple numbers in low precision isn't exact. This is especially the case with bf16 which has a lower precision than fp16. For this reason, fp16 is the default for reduction operations because the loss is minimal when averaging gradients.\n\nYou can choose the communication data type by setting the `communication_data_type` parameter in the config file. For example, choosing fp32 adds a small amount of overhead but ensures the reduction operation is accumulated in fp32 and when it is ready, it is downcasted to whichever half-precision dtype you're training in.\n\n```yaml\n{\n    \"communication_data_type\": \"fp32\"\n}\n```\n\n## Deployment\n\nDeepSpeed can be deployed by different launchers such as [torchrun](https://pytorch.org/docs/stable/elastic/run.html), the `deepspeed` launcher, or [Accelerate](https://huggingface.co/docs/accelerate/basic_tutorials/launch#using-accelerate-launch). To deploy, add `--deepspeed ds_config.json` to the [`Trainer`] command line. It\u2019s recommended to use DeepSpeed\u2019s [`add_config_arguments`](https://deepspeed.readthedocs.io/en/latest/initialize.html#argument-parsing) utility to add any necessary command line arguments to your code.\n\nThis guide will show you how to deploy DeepSpeed with the `deepspeed` launcher for different training setups. You can check out this [post](https://github.com/huggingface/transformers/issues/8771#issuecomment-759248400) for more practical usage examples.\n\n\n<hfoptions id=\"deploy\">\n<hfoption id=\"multi-GPU\">\n\nTo deploy DeepSpeed on multiple GPUs, add the `--num_gpus` parameter. If you want to use all available GPUs, you don't need to add `--num_gpus`. The example below uses 2 GPUs.\n\n```bash\ndeepspeed --num_gpus=2 examples/pytorch/translation/run_translation.py \\\n--deepspeed tests/deepspeed/ds_config_zero3.json \\\n--model_name_or_path google-t5/t5-small --per_device_train_batch_size 1 \\\n--output_dir output_dir --overwrite_output_dir --fp16 \\\n--do_train --max_train_samples 500 --num_train_epochs 1 \\\n--dataset_name wmt16 --dataset_config \"ro-en\" \\\n--source_lang en --target_lang ro\n```\n\n</hfoption>\n<hfoption id=\"single-GPU\">\n\nTo deploy DeepSpeed on a single GPU, add the `--num_gpus` parameter. It isn't necessary to explicitly set this value if you only have 1 GPU because DeepSpeed deploys all GPUs it can see on a given node.\n\n```bash\ndeepspeed --num_gpus=1 examples/pytorch/translation/run_translation.py \\\n--deepspeed tests/deepspeed/ds_config_zero2.json \\\n--model_name_or_path google-t5/t5-small --per_device_train_batch_size 1 \\\n--output_dir output_dir --overwrite_output_dir --fp16 \\\n--do_train --max_train_samples 500 --num_train_epochs 1 \\\n--dataset_name wmt16 --dataset_config \"ro-en\" \\\n--source_lang en --target_lang ro\n```\n\nDeepSpeed is still useful with just 1 GPU because you can:\n\n1."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 63d11a03-12b4-45f2-a6ba-21234995f7c5
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"63d11a03-12b4-45f2-a6ba-21234995f7c5\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5ca9aa9a-a5e4-45ac-87ee-17d695264654\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"ee7c2045ad8bcbcb3f505ffbfab8c50d85021fd8ba1316493bf2e37b3ccad00e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"6b5b2c19-cd56-484e-bed1-0e78c4265904\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"8400c1488b6c431fafc961f08640f129123276ea18f01ef5fe314bd62733e3c1\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 30037, \"end_char_idx\": 33159, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "<hfoptions id=\"deploy\">\n<hfoption id=\"multi-GPU\">\n\nTo deploy DeepSpeed on multiple GPUs, add the `--num_gpus` parameter. If you want to use all available GPUs, you don't need to add `--num_gpus`. The example below uses 2 GPUs.\n\n```bash\ndeepspeed --num_gpus=2 examples/pytorch/translation/run_translation.py \\\n--deepspeed tests/deepspeed/ds_config_zero3.json \\\n--model_name_or_path google-t5/t5-small --per_device_train_batch_size 1 \\\n--output_dir output_dir --overwrite_output_dir --fp16 \\\n--do_train --max_train_samples 500 --num_train_epochs 1 \\\n--dataset_name wmt16 --dataset_config \"ro-en\" \\\n--source_lang en --target_lang ro\n```\n\n</hfoption>\n<hfoption id=\"single-GPU\">\n\nTo deploy DeepSpeed on a single GPU, add the `--num_gpus` parameter. It isn't necessary to explicitly set this value if you only have 1 GPU because DeepSpeed deploys all GPUs it can see on a given node.\n\n```bash\ndeepspeed --num_gpus=1 examples/pytorch/translation/run_translation.py \\\n--deepspeed tests/deepspeed/ds_config_zero2.json \\\n--model_name_or_path google-t5/t5-small --per_device_train_batch_size 1 \\\n--output_dir output_dir --overwrite_output_dir --fp16 \\\n--do_train --max_train_samples 500 --num_train_epochs 1 \\\n--dataset_name wmt16 --dataset_config \"ro-en\" \\\n--source_lang en --target_lang ro\n```\n\nDeepSpeed is still useful with just 1 GPU because you can:\n\n1. Offload some computations and memory to the CPU to make more GPU resources available to your model to use a larger batch size or fit a very large model that normally won't fit.\n2. Minimize memory fragmentation with it's smart GPU memory management system which also allows you to fit bigger models and data batches.\n\n<Tip>\n\nSet the `allgather_bucket_size` and `reduce_bucket_size` values to 2e8 in the [ZeRO-2](#zero-configuration) configuration file to get better performance on a single GPU.\n\n</Tip>\n\n</hfoption>\n</hfoptions>\n\n### Multi-node deployment\n\nA node is one or more GPUs for running a workload. A more powerful setup is a multi-node setup which can be launched with the `deepspeed` launcher. For this guide, let's assume there are two nodes with 8 GPUs each. The first node can be accessed `ssh hostname1` and the second node with `ssh hostname2`. Both nodes must be able to communicate with each other locally over ssh without a password.\n\nBy default, DeepSpeed expects your multi-node environment to use a shared storage. If this is not the case and each node can only see the local filesystem, you need to adjust the config file to include a [`checkpoint`](https://www.deepspeed.ai/docs/config-json/#checkpoint-options) to allow loading without access to a shared filesystem:\n\n```yaml\n{\n  \"checkpoint\": {\n    \"use_node_local_storage\": true\n  }\n}\n```\n\nYou could also use the [`Trainer`]'s `--save_on_each_node` argument to automatically add the above `checkpoint` to your config.\n\n<hfoptions id=\"multinode\">\n<hfoption id=\"torchrun\">\n\nFor [torchrun](https://pytorch.org/docs/stable/elastic/run.html), you have to ssh to each node and run the following command on both of them. The launcher waits until both nodes are synchronized before launching the training."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 6b5b2c19-cd56-484e-bed1-0e78c4265904
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"6b5b2c19-cd56-484e-bed1-0e78c4265904\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"63d11a03-12b4-45f2-a6ba-21234995f7c5\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"45285b8914e837cc47e5510c45fd84e60a3f99485c03fe9f266f4461b5f4a018\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a64c6cd6-2ccc-4247-b9dc-9f4adf42f59c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6700ab39d5b5a7bf4cb4580fc20616a9a663fb33e6871c17725f4588b307e8d8\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 31563, \"end_char_idx\": 34355, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "2. Minimize memory fragmentation with it's smart GPU memory management system which also allows you to fit bigger models and data batches.\n\n<Tip>\n\nSet the `allgather_bucket_size` and `reduce_bucket_size` values to 2e8 in the [ZeRO-2](#zero-configuration) configuration file to get better performance on a single GPU.\n\n</Tip>\n\n</hfoption>\n</hfoptions>\n\n### Multi-node deployment\n\nA node is one or more GPUs for running a workload. A more powerful setup is a multi-node setup which can be launched with the `deepspeed` launcher. For this guide, let's assume there are two nodes with 8 GPUs each. The first node can be accessed `ssh hostname1` and the second node with `ssh hostname2`. Both nodes must be able to communicate with each other locally over ssh without a password.\n\nBy default, DeepSpeed expects your multi-node environment to use a shared storage. If this is not the case and each node can only see the local filesystem, you need to adjust the config file to include a [`checkpoint`](https://www.deepspeed.ai/docs/config-json/#checkpoint-options) to allow loading without access to a shared filesystem:\n\n```yaml\n{\n  \"checkpoint\": {\n    \"use_node_local_storage\": true\n  }\n}\n```\n\nYou could also use the [`Trainer`]'s `--save_on_each_node` argument to automatically add the above `checkpoint` to your config.\n\n<hfoptions id=\"multinode\">\n<hfoption id=\"torchrun\">\n\nFor [torchrun](https://pytorch.org/docs/stable/elastic/run.html), you have to ssh to each node and run the following command on both of them. The launcher waits until both nodes are synchronized before launching the training.\n\n```bash\ntorchrun --nproc_per_node=8 --nnode=2 --node_rank=0 --master_addr=hostname1 \\\n--master_port=9901 your_program.py <normal cl args> --deepspeed ds_config.json\n```\n\n</hfoption>\n<hfoption id=\"deepspeed\">\n\nFor the `deepspeed` launcher, start by creating a `hostfile`.\n\n```bash\nhostname1 slots=8\nhostname2 slots=8\n```\n\nThen you can launch the training with the following command. The `deepspeed` launcher automatically launches the command on both nodes at once.\n\n```bash\ndeepspeed --num_gpus 8 --num_nodes 2 --hostfile hostfile --master_addr hostname1 --master_port=9901 \\\nyour_program.py <normal cl args> --deepspeed ds_config.json\n```\n\nCheck out the [Resource Configuration (multi-node)](https://www.deepspeed.ai/getting-started/#resource-configuration-multi-node) guide for more details about configuring multi-node compute resources.\n\n</hfoption>\n</hfoptions>\n\n### SLURM\n\nIn a SLURM environment, you'll need to adapt your SLURM script to your specific SLURM environment. An example SLURM script may look like:\n\n```bash\n#SBATCH --job-name=test-nodes        # name\n#SBATCH --nodes=2                    # nodes\n#SBATCH --ntasks-per-node=1          # crucial - only 1 task per dist per node!"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a64c6cd6-2ccc-4247-b9dc-9f4adf42f59c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a64c6cd6-2ccc-4247-b9dc-9f4adf42f59c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"6b5b2c19-cd56-484e-bed1-0e78c4265904\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9d3815082be71e613fe8db4e41c119cdc09f4433f904cdc07a65fe71182f18ca\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"bb7ba753-0705-41fd-9c87-7fa1896803d7\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b6645005c21e1286b0082b2671cdad41dcffc1fd27e1beeb5059d991e6120c12\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 32881, \"end_char_idx\": 35623, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "<hfoptions id=\"multinode\">\n<hfoption id=\"torchrun\">\n\nFor [torchrun](https://pytorch.org/docs/stable/elastic/run.html), you have to ssh to each node and run the following command on both of them. The launcher waits until both nodes are synchronized before launching the training.\n\n```bash\ntorchrun --nproc_per_node=8 --nnode=2 --node_rank=0 --master_addr=hostname1 \\\n--master_port=9901 your_program.py <normal cl args> --deepspeed ds_config.json\n```\n\n</hfoption>\n<hfoption id=\"deepspeed\">\n\nFor the `deepspeed` launcher, start by creating a `hostfile`.\n\n```bash\nhostname1 slots=8\nhostname2 slots=8\n```\n\nThen you can launch the training with the following command. The `deepspeed` launcher automatically launches the command on both nodes at once.\n\n```bash\ndeepspeed --num_gpus 8 --num_nodes 2 --hostfile hostfile --master_addr hostname1 --master_port=9901 \\\nyour_program.py <normal cl args> --deepspeed ds_config.json\n```\n\nCheck out the [Resource Configuration (multi-node)](https://www.deepspeed.ai/getting-started/#resource-configuration-multi-node) guide for more details about configuring multi-node compute resources.\n\n</hfoption>\n</hfoptions>\n\n### SLURM\n\nIn a SLURM environment, you'll need to adapt your SLURM script to your specific SLURM environment. An example SLURM script may look like:\n\n```bash\n#SBATCH --job-name=test-nodes        # name\n#SBATCH --nodes=2                    # nodes\n#SBATCH --ntasks-per-node=1          # crucial - only 1 task per dist per node!\n#SBATCH --cpus-per-task=10           # number of cores per tasks\n#SBATCH --gres=gpu:8                 # number of gpus\n#SBATCH --time 20:00:00              # maximum execution time (HH:MM:SS)\n#SBATCH --output=%x-%j.out           # output file name\n\nexport GPUS_PER_NODE=8\nexport MASTER_ADDR=$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n 1)\nexport MASTER_PORT=9901\n\nsrun --jobid $SLURM_JOBID bash -c 'python -m torch.distributed.run \\\n --nproc_per_node $GPUS_PER_NODE --nnodes $SLURM_NNODES --node_rank $SLURM_PROCID \\\n --master_addr $MASTER_ADDR --master_port $MASTER_PORT \\\nyour_program.py <normal cl args> --deepspeed ds_config.json'\n```\n\nThen you can schedule your multi-node deployment with the following command which launches training simultaneously on all nodes.\n\n```bash\nsbatch launch.slurm\n```\n\n### Notebook\n\nThe `deepspeed` launcher doesn't support deployment from a notebook so you'll need to emulate the distributed environment. However, this only works for 1 GPU. If you want to use more than 1 GPU, you must use a multi-process environment for DeepSpeed to work. This means you have to use the `deepspeed` launcher which can't be emulated as shown here.\n\n```py\n# DeepSpeed requires a distributed environment even when only one process is used."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: bb7ba753-0705-41fd-9c87-7fa1896803d7
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"bb7ba753-0705-41fd-9c87-7fa1896803d7\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a64c6cd6-2ccc-4247-b9dc-9f4adf42f59c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"b70595f8055e919ef147e5c0162554095608b332392d6cc8d043b0689a6793a8\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7fc8ccb3-0325-4d3e-9ea4-36e3ccbd5d70\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ed5fc67b85481cf8284f99a78f496c7902f6281d388dc92ee78a6a4d6187b8db\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 34139, \"end_char_idx\": 36192, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "An example SLURM script may look like:\n\n```bash\n#SBATCH --job-name=test-nodes        # name\n#SBATCH --nodes=2                    # nodes\n#SBATCH --ntasks-per-node=1          # crucial - only 1 task per dist per node!\n#SBATCH --cpus-per-task=10           # number of cores per tasks\n#SBATCH --gres=gpu:8                 # number of gpus\n#SBATCH --time 20:00:00              # maximum execution time (HH:MM:SS)\n#SBATCH --output=%x-%j.out           # output file name\n\nexport GPUS_PER_NODE=8\nexport MASTER_ADDR=$(scontrol show hostnames $SLURM_JOB_NODELIST | head -n 1)\nexport MASTER_PORT=9901\n\nsrun --jobid $SLURM_JOBID bash -c 'python -m torch.distributed.run \\\n --nproc_per_node $GPUS_PER_NODE --nnodes $SLURM_NNODES --node_rank $SLURM_PROCID \\\n --master_addr $MASTER_ADDR --master_port $MASTER_PORT \\\nyour_program.py <normal cl args> --deepspeed ds_config.json'\n```\n\nThen you can schedule your multi-node deployment with the following command which launches training simultaneously on all nodes.\n\n```bash\nsbatch launch.slurm\n```\n\n### Notebook\n\nThe `deepspeed` launcher doesn't support deployment from a notebook so you'll need to emulate the distributed environment. However, this only works for 1 GPU. If you want to use more than 1 GPU, you must use a multi-process environment for DeepSpeed to work. This means you have to use the `deepspeed` launcher which can't be emulated as shown here.\n\n```py\n# DeepSpeed requires a distributed environment even when only one process is used.\n# This emulates a launcher in the notebook\nimport os\n\nos.environ[\"MASTER_ADDR\"] = \"localhost\"\nos.environ[\"MASTER_PORT\"] = \"9994\"  # modify if RuntimeError: Address already in use\nos.environ[\"RANK\"] = \"0\"\nos.environ[\"LOCAL_RANK\"] = \"0\"\nos.environ[\"WORLD_SIZE\"] = \"1\"\n\n# Now proceed as normal, plus pass the DeepSpeed config file\ntraining_args = TrainingArguments(..., deepspeed=\"ds_config_zero3.json\")\ntrainer = Trainer(...)\ntrainer.train()\n```\n\nIf you want to create the config file on the fly in the notebook in the current directory, you could have a dedicated cell."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 7fc8ccb3-0325-4d3e-9ea4-36e3ccbd5d70
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"7fc8ccb3-0325-4d3e-9ea4-36e3ccbd5d70\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"bb7ba753-0705-41fd-9c87-7fa1896803d7\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"6562b1a1e718bb05d6f9dd6e5a39b9655d757acf54e8b344760b175313d7f5ce\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b6612c4b-cb19-4148-8ece-030a77e366b9\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"1fc13e4f41510f9748c5999738a99581e93c4d8d01a6fe635d09fee4417bdbae\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 35137, \"end_char_idx\": 37836, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "```bash\nsbatch launch.slurm\n```\n\n### Notebook\n\nThe `deepspeed` launcher doesn't support deployment from a notebook so you'll need to emulate the distributed environment. However, this only works for 1 GPU. If you want to use more than 1 GPU, you must use a multi-process environment for DeepSpeed to work. This means you have to use the `deepspeed` launcher which can't be emulated as shown here.\n\n```py\n# DeepSpeed requires a distributed environment even when only one process is used.\n# This emulates a launcher in the notebook\nimport os\n\nos.environ[\"MASTER_ADDR\"] = \"localhost\"\nos.environ[\"MASTER_PORT\"] = \"9994\"  # modify if RuntimeError: Address already in use\nos.environ[\"RANK\"] = \"0\"\nos.environ[\"LOCAL_RANK\"] = \"0\"\nos.environ[\"WORLD_SIZE\"] = \"1\"\n\n# Now proceed as normal, plus pass the DeepSpeed config file\ntraining_args = TrainingArguments(..., deepspeed=\"ds_config_zero3.json\")\ntrainer = Trainer(...)\ntrainer.train()\n```\n\nIf you want to create the config file on the fly in the notebook in the current directory, you could have a dedicated cell.\n\n```py\n%%bash\ncat <<'EOT' > ds_config_zero3.json\n{\n    \"fp16\": {\n        \"enabled\": \"auto\",\n        \"loss_scale\": 0,\n        \"loss_scale_window\": 1000,\n        \"initial_scale_power\": 16,\n        \"hysteresis\": 2,\n        \"min_loss_scale\": 1\n    },\n\n    \"optimizer\": {\n        \"type\": \"AdamW\",\n        \"params\": {\n            \"lr\": \"auto\",\n            \"betas\": \"auto\",\n            \"eps\": \"auto\",\n            \"weight_decay\": \"auto\"\n        }\n    },\n\n    \"scheduler\": {\n        \"type\": \"WarmupLR\",\n        \"params\": {\n            \"warmup_min_lr\": \"auto\",\n            \"warmup_max_lr\": \"auto\",\n            \"warmup_num_steps\": \"auto\"\n        }\n    },\n\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_optimizer\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"offload_param\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": true\n        },\n        \"overlap_comm\": true,\n        \"contiguous_gradients\": true,\n        \"sub_group_size\": 1e9,\n        \"reduce_bucket_size\": \"auto\",\n        \"stage3_prefetch_bucket_size\": \"auto\",\n        \"stage3_param_persistence_threshold\": \"auto\",\n        \"stage3_max_live_parameters\": 1e9,\n        \"stage3_max_reuse_distance\": 1e9,\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    },\n\n    \"gradient_accumulation_steps\": \"auto\",\n    \"gradient_clipping\": \"auto\",\n    \"steps_per_print\": 2000,\n    \"train_batch_size\": \"auto\",\n    \"train_micro_batch_size_per_gpu\": \"auto\",\n    \"wall_clock_breakdown\": false\n}\nEOT\n```\n\nIf the training script is in a file and not in a notebook cell, you can launch `deepspeed` normally from the shell in a notebook cell."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: b6612c4b-cb19-4148-8ece-030a77e366b9
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"b6612c4b-cb19-4148-8ece-030a77e366b9\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"7fc8ccb3-0325-4d3e-9ea4-36e3ccbd5d70\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"edc3d93f0043851ec3149c57aba438d73cc2e520e98474f3071643e66e541690\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"e00c43ac-a15f-4e06-a4fc-ef0925c86c37\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"20888e50e29d7df9606751a329a30ed75fd4e57255c9e46abc727aa5d583ac93\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 37837, \"end_char_idx\": 40898, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "For example, to launch `run_translation.py`:\n\n```py\n!git clone https://github.com/huggingface/transformers\n!cd transformers; deepspeed examples/pytorch/translation/run_translation.py ...\n```\n\nYou could also use `%%bash` magic and write multi-line code to run the shell program, but you won't be able to view the logs until training is complete. With `%%bash` magic, you don't need to emulate a distributed environment.\n\n```py\n%%bash\n\ngit clone https://github.com/huggingface/transformers\ncd transformers\ndeepspeed examples/pytorch/translation/run_translation.py ...\n```\n\n## Save model weights\n\nDeepSpeed stores the main full precision fp32 weights in custom checkpoint optimizer files (the glob pattern looks like `global_step*/*optim_states.pt`) and are saved under the normal checkpoint.\n\n<hfoptions id=\"save\">\n<hfoption id=\"fp16\">\n\nA model trained with ZeRO-2 saves the pytorch_model.bin weights in fp16. To save the model weights in fp16 for a model trained with ZeRO-3, you need to set `\"stage3_gather_16bit_weights_on_model_save\": true` because the model weights are partitioned across multiple GPUs. Otherwise, the [`Trainer`] won't save the weights in fp16 and it won't create a pytorch_model.bin file. This is because DeepSpeed's state_dict contains a placeholder instead of the real weights and you won't be able to load them.\n\n```yaml\n{\n    \"zero_optimization\": {\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"fp32\">\n\nThe full precision weights shouldn't be saved during training because it can require a lot of memory. It is usually best to save the fp32 weights offline after training is complete. But if you have a lot of free CPU memory, it is possible to save the fp32 weights during training. This section covers both online and offline approaches.\n\n### Online\n\nYou must have saved at least one checkpoint to load the latest checkpoint as shown in the following:\n\n```py\nfrom transformers.trainer_utils import get_last_checkpoint\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = get_last_checkpoint(trainer.args.output_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\nIf you've enabled the `--load_best_model_at_end` parameter to track the best checkpoint in [`TrainingArguments`], you can finish training first and save the final model explicitly. Then you can reload it as shown below:\n\n```py\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = os.path.join(trainer.args.output_dir, \"checkpoint-final\")\ntrainer.deepspeed.save_checkpoint(checkpoint_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\n<Tip>\n\nOnce `load_state_dict_from_zero_checkpoint` is run, the model is no longer usable in DeepSpeed in the context of the same application. You'll need to initialize the DeepSpeed engine again since `model.load_state_dict(state_dict)` removes all the DeepSpeed magic from it. Only use this at the very end of training."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: e00c43ac-a15f-4e06-a4fc-ef0925c86c37
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"e00c43ac-a15f-4e06-a4fc-ef0925c86c37\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b6612c4b-cb19-4148-8ece-030a77e366b9\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"91e1481a5728aaf3be9f1a57d6fb924500cc8726bc93cd421a3a52df7e34c817\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ea84ebfa-220a-4a95-95a7-f1c6e6d4669a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"51c3cdc4c60328e39e9f3d56d940885bb0aba06d345681fb5bd03b6515cc8961\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 39175, \"end_char_idx\": 41430, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "```yaml\n{\n    \"zero_optimization\": {\n        \"stage3_gather_16bit_weights_on_model_save\": true\n    }\n}\n```\n\n</hfoption>\n<hfoption id=\"fp32\">\n\nThe full precision weights shouldn't be saved during training because it can require a lot of memory. It is usually best to save the fp32 weights offline after training is complete. But if you have a lot of free CPU memory, it is possible to save the fp32 weights during training. This section covers both online and offline approaches.\n\n### Online\n\nYou must have saved at least one checkpoint to load the latest checkpoint as shown in the following:\n\n```py\nfrom transformers.trainer_utils import get_last_checkpoint\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = get_last_checkpoint(trainer.args.output_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\nIf you've enabled the `--load_best_model_at_end` parameter to track the best checkpoint in [`TrainingArguments`], you can finish training first and save the final model explicitly. Then you can reload it as shown below:\n\n```py\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = os.path.join(trainer.args.output_dir, \"checkpoint-final\")\ntrainer.deepspeed.save_checkpoint(checkpoint_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\n<Tip>\n\nOnce `load_state_dict_from_zero_checkpoint` is run, the model is no longer usable in DeepSpeed in the context of the same application. You'll need to initialize the DeepSpeed engine again since `model.load_state_dict(state_dict)` removes all the DeepSpeed magic from it. Only use this at the very end of training.\n\n</Tip>\n\nYou can also extract and load the state_dict of the fp32 weights:\n\n```py\nfrom deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint\n\nstate_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir)  # already on cpu\nmodel = model.cpu()\nmodel.load_state_dict(state_dict)\n```\n\n### Offline\n\nDeepSpeed provides a zero_to_fp32.py script at the top-level of the checkpoint folder for extracting weights at any point. This is a standalone script and you don't need a configuration file or [`Trainer`]."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ea84ebfa-220a-4a95-95a7-f1c6e6d4669a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"ea84ebfa-220a-4a95-95a7-f1c6e6d4669a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e00c43ac-a15f-4e06-a4fc-ef0925c86c37\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"bc6250ad915409cdda736c156bdfa9c06fd86a8304fe91aec8998406671e13c1\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ca05393b-c275-4a02-8f1b-98e4bcdf539a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"7f929c4725a79004d526026ec489672acf83bdc611dc090fbe4379bb3b0d1971\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 39598, \"end_char_idx\": 42455, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "This section covers both online and offline approaches.\n\n### Online\n\nYou must have saved at least one checkpoint to load the latest checkpoint as shown in the following:\n\n```py\nfrom transformers.trainer_utils import get_last_checkpoint\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = get_last_checkpoint(trainer.args.output_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\nIf you've enabled the `--load_best_model_at_end` parameter to track the best checkpoint in [`TrainingArguments`], you can finish training first and save the final model explicitly. Then you can reload it as shown below:\n\n```py\nfrom deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint\n\ncheckpoint_dir = os.path.join(trainer.args.output_dir, \"checkpoint-final\")\ntrainer.deepspeed.save_checkpoint(checkpoint_dir)\nfp32_model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)\n```\n\n<Tip>\n\nOnce `load_state_dict_from_zero_checkpoint` is run, the model is no longer usable in DeepSpeed in the context of the same application. You'll need to initialize the DeepSpeed engine again since `model.load_state_dict(state_dict)` removes all the DeepSpeed magic from it. Only use this at the very end of training.\n\n</Tip>\n\nYou can also extract and load the state_dict of the fp32 weights:\n\n```py\nfrom deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint\n\nstate_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir)  # already on cpu\nmodel = model.cpu()\nmodel.load_state_dict(state_dict)\n```\n\n### Offline\n\nDeepSpeed provides a zero_to_fp32.py script at the top-level of the checkpoint folder for extracting weights at any point. This is a standalone script and you don't need a configuration file or [`Trainer`].\n\nFor example, if your checkpoint folder looked like this:\n\n```bash\n$ ls -l output_dir/checkpoint-1/\n-rw-rw-r-- 1 stas stas 1.4K Mar 27 20:42 config.json\ndrwxrwxr-x 2 stas stas 4.0K Mar 25 19:52 global_step1/\n-rw-rw-r-- 1 stas stas   12 Mar 27 13:16 latest\n-rw-rw-r-- 1 stas stas 827K Mar 27 20:42 optimizer.pt\n-rw-rw-r-- 1 stas stas 231M Mar 27 20:42 pytorch_model.bin\n-rw-rw-r-- 1 stas stas  623 Mar 27 20:42 scheduler.pt\n-rw-rw-r-- 1 stas stas 1.8K Mar 27 20:42 special_tokens_map.json\n-rw-rw-r-- 1 stas stas 774K Mar 27 20:42 spiece.model\n-rw-rw-r-- 1 stas stas 1.9K Mar 27 20:42 tokenizer_config.json\n-rw-rw-r-- 1 stas stas  339 Mar 27 20:42 trainer_state.json\n-rw-rw-r-- 1 stas stas 2.3K Mar 27 20:42 training_args.bin\n-rwxrw-r-- 1 stas stas 5.5K Mar 27 13:16 zero_to_fp32.py*\n```\n\nTo reconstruct the fp32 weights from the DeepSpeed checkpoint (ZeRO-2 or ZeRO-3) subfolder `global_step1`, run the following command to create and consolidate the full fp32 weights from multiple GPUs into a single pytorch_model.bin file."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ca05393b-c275-4a02-8f1b-98e4bcdf539a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"ca05393b-c275-4a02-8f1b-98e4bcdf539a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ea84ebfa-220a-4a95-95a7-f1c6e6d4669a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"86b7c0c13dfbffca53b68a5944efb486535b1e23dc64c92d555add97d07d7d8c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a9b22bb3-4616-409e-ae1f-72a4f7120b9e\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"3cf560e95490b20f80fddaaba9ac8641a7b08ab155af421cbdacb264135fc3eb\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 42456, \"end_char_idx\": 45633, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "The script automatically discovers the subfolder containing the checkpoint.\n\n```py\npython zero_to_fp32.py . pytorch_model.bin\n```\n\n<Tip>\n\nRun `python zero_to_fp32.py -h` for more usage details. The script requires 2x the general RAM of the final fp32 weights.\n\n</Tip>\n\n</hfoption>\n</hfoptions>\n\n## ZeRO Inference\n\n[ZeRO Inference](https://www.deepspeed.ai/2022/09/09/zero-inference.html) places the model weights in CPU or NVMe memory to avoid burdening the GPU which makes it possible to run inference with huge models on a GPU. Inference doesn't require any large additional amounts of memory for the optimizer states and gradients so you can fit much larger batches and/or sequence lengths on the same hardware.\n\nZeRO Inference shares the same configuration file as [ZeRO-3](#zero-configuration), and ZeRO-2 and ZeRO-1 configs won't work because they don't provide any benefits for inference.\n\nTo run ZeRO Inference, pass your usual training arguments to the [`TrainingArguments`] class and add the `--do_eval` argument.\n\n```bash\ndeepspeed --num_gpus=2 your_program.py <normal cl args> --do_eval --deepspeed ds_config.json\n```\n\n## Non-Trainer DeepSpeed integration\n\nDeepSpeed also works with Transformers without the [`Trainer`] class. This is handled by the [`HfDeepSpeedConfig`] which only takes care of gathering ZeRO-3 parameters and splitting a model across multiple GPUs when you call [`~PreTrainedModel.from_pretrained`].\n\n<Tip>\n\nIf you want everything automatically taken care of for you, try using DeepSpeed with the [`Trainer`]! You'll need to follow the [DeepSpeed documentation](https://www.deepspeed.ai/), and manually configure the parameter values in the config file (you can't use the `\"auto\"` value).\n\n</Tip>\n\nTo efficiently deploy ZeRO-3, you must instantiate the [`HfDeepSpeedConfig`] object before the model and keep that object alive:\n\n<hfoptions id=\"models\">\n<hfoption id=\"pretrained model\">\n\n```py\nfrom transformers.integrations import HfDeepSpeedConfig\nfrom transformers import AutoModel\nimport deepspeed\n\nds_config = {...}  # deepspeed config object or path to the file\n# must run before instantiating the model to detect zero 3\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\nmodel = AutoModel.from_pretrained(\"openai-community/gpt2\")\nengine = deepspeed.initialize(model=model, config_params=ds_config, ...)\n```\n\n</hfoption>\n<hfoption id=\"non-pretrained model\">\n\n[`HfDeepSpeedConfig`] is not required for ZeRO-1 or ZeRO-2.\n\n```py\nfrom transformers.integrations import HfDeepSpeedConfig\nfrom transformers import AutoModel, AutoConfig\nimport deepspeed\n\nds_config = {...}  # deepspeed config object or path to the file\n# must run before instantiating the model to detect zero 3\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\nconfig = AutoConfig.from_pretrained(\"openai-community/gpt2\")\nmodel = AutoModel.from_config(config)\nengine = deepspeed.initialize(model=model, config_params=ds_config, ...)\n```\n\n</hfoption>\n</hfoptions>\n\n### Non-Trainer ZeRO Inference\n\nTo run ZeRO Inference without the [`Trainer`] in cases where you can\u2019t fit a model onto a single GPU, try using additional GPUs or/and offloading to CPU memory."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a9b22bb3-4616-409e-ae1f-72a4f7120b9e
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a9b22bb3-4616-409e-ae1f-72a4f7120b9e\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ca05393b-c275-4a02-8f1b-98e4bcdf539a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"7c0d9fc2d8ca89556642ec4782fc20c488c9010606b14594b6071e5b783cbe60\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a76c46ae-efb5-4248-93c1-a4d4de0ea5c0\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"bc502238b44027b2e5282dd3a487ae1c8d8123140144a8359ae32f17957e2782\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 44178, \"end_char_idx\": 47184, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "</Tip>\n\nTo efficiently deploy ZeRO-3, you must instantiate the [`HfDeepSpeedConfig`] object before the model and keep that object alive:\n\n<hfoptions id=\"models\">\n<hfoption id=\"pretrained model\">\n\n```py\nfrom transformers.integrations import HfDeepSpeedConfig\nfrom transformers import AutoModel\nimport deepspeed\n\nds_config = {...}  # deepspeed config object or path to the file\n# must run before instantiating the model to detect zero 3\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\nmodel = AutoModel.from_pretrained(\"openai-community/gpt2\")\nengine = deepspeed.initialize(model=model, config_params=ds_config, ...)\n```\n\n</hfoption>\n<hfoption id=\"non-pretrained model\">\n\n[`HfDeepSpeedConfig`] is not required for ZeRO-1 or ZeRO-2.\n\n```py\nfrom transformers.integrations import HfDeepSpeedConfig\nfrom transformers import AutoModel, AutoConfig\nimport deepspeed\n\nds_config = {...}  # deepspeed config object or path to the file\n# must run before instantiating the model to detect zero 3\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\nconfig = AutoConfig.from_pretrained(\"openai-community/gpt2\")\nmodel = AutoModel.from_config(config)\nengine = deepspeed.initialize(model=model, config_params=ds_config, ...)\n```\n\n</hfoption>\n</hfoptions>\n\n### Non-Trainer ZeRO Inference\n\nTo run ZeRO Inference without the [`Trainer`] in cases where you can\u2019t fit a model onto a single GPU, try using additional GPUs or/and offloading to CPU memory. The important nuance to understand here is that the way ZeRO is designed, you can process different inputs on different GPUs in parallel.\n\nMake sure to:\n\n* disable CPU offload if you have enough GPU memory (since it slows things down).\n* enable bf16 if you have an Ampere or newer GPU to make things faster. If you don\u2019t have one of these GPUs, you may enable fp16 as long as you don\u2019t use a model pretrained in bf16 (T5 models) because it may lead to an overflow error.\n\nTake a look at the following script to get a better idea of how to run ZeRO Inference without the [`Trainer`] on a model that won't fit on a single GPU.\n\n```py\n#!/usr/bin/env python\n\n# This script demonstrates how to use Deepspeed ZeRO in an inference mode when one can't fit a model\n# into a single GPU\n#\n# 1. Use 1 GPU with CPU offload\n# 2. Or use multiple GPUs instead\n#\n# First you need to install deepspeed: pip install deepspeed\n#\n# Here we use a 3B \"bigscience/T0_3B\" model which needs about 15GB GPU RAM - so 1 largish or 2\n# small GPUs can handle it. or 1 small GPU and a lot of CPU memory.\n#\n# To use a larger model like \"bigscience/T0\" which needs about 50GB, unless you have an 80GB GPU -\n# you will need 2-4 gpus. And then you can adapt the script to handle more gpus if you want to\n# process multiple inputs at once.\n#\n# The provided deepspeed config also activates CPU memory offloading, so chances are that if you\n# have a lot of available CPU memory and you don't mind a slowdown you should be able to load a\n# model that doesn't normally fit into a single GPU."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a76c46ae-efb5-4248-93c1-a4d4de0ea5c0
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a76c46ae-efb5-4248-93c1-a4d4de0ea5c0\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a9b22bb3-4616-409e-ae1f-72a4f7120b9e\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"3ff8b40bb4341160681ffe2b8cb02ead7457ca387da1ea443b0d9a9e9a11bc74\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"69c90725-5da3-4310-a52c-959d19f7e9eb\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"7415ba0d0d9abd3b32a52e28afbde2a793d58b977230237603673bf09f5e7749\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 45773, \"end_char_idx\": 48464, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Make sure to:\n\n* disable CPU offload if you have enough GPU memory (since it slows things down).\n* enable bf16 if you have an Ampere or newer GPU to make things faster. If you don\u2019t have one of these GPUs, you may enable fp16 as long as you don\u2019t use a model pretrained in bf16 (T5 models) because it may lead to an overflow error.\n\nTake a look at the following script to get a better idea of how to run ZeRO Inference without the [`Trainer`] on a model that won't fit on a single GPU.\n\n```py\n#!/usr/bin/env python\n\n# This script demonstrates how to use Deepspeed ZeRO in an inference mode when one can't fit a model\n# into a single GPU\n#\n# 1. Use 1 GPU with CPU offload\n# 2. Or use multiple GPUs instead\n#\n# First you need to install deepspeed: pip install deepspeed\n#\n# Here we use a 3B \"bigscience/T0_3B\" model which needs about 15GB GPU RAM - so 1 largish or 2\n# small GPUs can handle it. or 1 small GPU and a lot of CPU memory.\n#\n# To use a larger model like \"bigscience/T0\" which needs about 50GB, unless you have an 80GB GPU -\n# you will need 2-4 gpus. And then you can adapt the script to handle more gpus if you want to\n# process multiple inputs at once.\n#\n# The provided deepspeed config also activates CPU memory offloading, so chances are that if you\n# have a lot of available CPU memory and you don't mind a slowdown you should be able to load a\n# model that doesn't normally fit into a single GPU. If you have enough GPU memory the program will\n# run faster if you don't want offload to CPU - so disable that section then.\n#\n# To deploy on 1 gpu:\n#\n# deepspeed --num_gpus 1 t0.py\n# or:\n# python -m torch.distributed.run --nproc_per_node=1 t0.py\n#\n# To deploy on 2 gpus:\n#\n# deepspeed --num_gpus 2 t0.py\n# or:\n# python -m torch.distributed.run --nproc_per_node=2 t0.py\n\nfrom transformers import AutoTokenizer, AutoConfig, AutoModelForSeq2SeqLM\nfrom transformers.integrations import HfDeepSpeedConfig\nimport deepspeed\nimport os\nimport torch\n\nos.environ[\"TOKENIZERS_PARALLELISM\"] = \"false\"  # To avoid warnings about parallelism in tokenizers\n\n# distributed setup\nlocal_rank = int(os.getenv(\"LOCAL_RANK\", \"0\"))\nworld_size = int(os.getenv(\"WORLD_SIZE\", \"1\"))\ntorch.cuda.set_device(local_rank)\ndeepspeed.init_distributed()\n\nmodel_name = \"bigscience/T0_3B\"\n\nconfig = AutoConfig.from_pretrained(model_name)\nmodel_hidden_size = config.d_model\n\n# batch size has to be divisible by world_size, but can be bigger than world_size\ntrain_batch_size = 1 * world_size\n\n# ds_config notes\n#\n# - enable bf16 if you use Ampere or higher GPU - this will run in mixed precision and will be\n# faster.\n#\n# - for older GPUs you can enable fp16, but it'll only work for non-bf16 pretrained models - e.g."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 69c90725-5da3-4310-a52c-959d19f7e9eb
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"69c90725-5da3-4310-a52c-959d19f7e9eb\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a76c46ae-efb5-4248-93c1-a4d4de0ea5c0\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"ce676a46278da14be1c0bba3aff81efec0b8b227bfd9da4961679f46ea6ccda5\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"e03d0f92-6011-4b7a-8041-445921534c51\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"d3bf100c4b6cdc92113609c0209b02f97789cf74ea8d4f6e95dd1ad6fcc492fd\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 47185, \"end_char_idx\": 49918, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "If you have enough GPU memory the program will\n# run faster if you don't want offload to CPU - so disable that section then.\n#\n# To deploy on 1 gpu:\n#\n# deepspeed --num_gpus 1 t0.py\n# or:\n# python -m torch.distributed.run --nproc_per_node=1 t0.py\n#\n# To deploy on 2 gpus:\n#\n# deepspeed --num_gpus 2 t0.py\n# or:\n# python -m torch.distributed.run --nproc_per_node=2 t0.py\n\nfrom transformers import AutoTokenizer, AutoConfig, AutoModelForSeq2SeqLM\nfrom transformers.integrations import HfDeepSpeedConfig\nimport deepspeed\nimport os\nimport torch\n\nos.environ[\"TOKENIZERS_PARALLELISM\"] = \"false\"  # To avoid warnings about parallelism in tokenizers\n\n# distributed setup\nlocal_rank = int(os.getenv(\"LOCAL_RANK\", \"0\"))\nworld_size = int(os.getenv(\"WORLD_SIZE\", \"1\"))\ntorch.cuda.set_device(local_rank)\ndeepspeed.init_distributed()\n\nmodel_name = \"bigscience/T0_3B\"\n\nconfig = AutoConfig.from_pretrained(model_name)\nmodel_hidden_size = config.d_model\n\n# batch size has to be divisible by world_size, but can be bigger than world_size\ntrain_batch_size = 1 * world_size\n\n# ds_config notes\n#\n# - enable bf16 if you use Ampere or higher GPU - this will run in mixed precision and will be\n# faster.\n#\n# - for older GPUs you can enable fp16, but it'll only work for non-bf16 pretrained models - e.g.\n# all official t5 models are bf16-pretrained\n#\n# - set offload_param.device to \"none\" or completely remove the `offload_param` section if you don't\n# - want CPU offload\n#\n# - if using `offload_param` you can manually finetune stage3_param_persistence_threshold to control\n# - which params should remain on gpus - the larger the value the smaller the offload size\n#\n# For in-depth info on Deepspeed config see\n# https://huggingface.co/docs/transformers/main/main_classes/deepspeed\n\n# keeping the same format as json for consistency, except it uses lower case for true/false\n# fmt: off\nds_config = {\n    \"fp16\": {\n        \"enabled\": False\n    },\n    \"bf16\": {\n        \"enabled\": False\n    },\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_param\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": True\n        },\n        \"overlap_comm\": True,\n        \"contiguous_gradients\": True,\n        \"reduce_bucket_size\": model_hidden_size * model_hidden_size,\n        \"stage3_prefetch_bucket_size\": 0.9 * model_hidden_size * model_hidden_size,\n        \"stage3_param_persistence_threshold\": 10 * model_hidden_size\n    },\n    \"steps_per_print\": 2000,\n    \"train_batch_size\": train_batch_size,\n    \"train_micro_batch_size_per_gpu\": 1,\n    \"wall_clock_breakdown\": False\n}\n# fmt: on\n\n# next line instructs transformers to partition the model directly over multiple gpus using\n# deepspeed.zero.Init when model's `from_pretrained` method is called."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: e03d0f92-6011-4b7a-8041-445921534c51
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"e03d0f92-6011-4b7a-8041-445921534c51\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"69c90725-5da3-4310-a52c-959d19f7e9eb\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"e2d9f0cae8cd71625fa7ca153ed4e04a5df70fb35857436c2f846ce7453e0c6b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ddbb91b3-96c0-44f1-bbd5-5c8d0a10b405\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f992ddf2a684638556da25a46c2ccf32caa85cf42436590352c56838ab0cb6e0\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 48365, \"end_char_idx\": 51041, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "#\n# - for older GPUs you can enable fp16, but it'll only work for non-bf16 pretrained models - e.g.\n# all official t5 models are bf16-pretrained\n#\n# - set offload_param.device to \"none\" or completely remove the `offload_param` section if you don't\n# - want CPU offload\n#\n# - if using `offload_param` you can manually finetune stage3_param_persistence_threshold to control\n# - which params should remain on gpus - the larger the value the smaller the offload size\n#\n# For in-depth info on Deepspeed config see\n# https://huggingface.co/docs/transformers/main/main_classes/deepspeed\n\n# keeping the same format as json for consistency, except it uses lower case for true/false\n# fmt: off\nds_config = {\n    \"fp16\": {\n        \"enabled\": False\n    },\n    \"bf16\": {\n        \"enabled\": False\n    },\n    \"zero_optimization\": {\n        \"stage\": 3,\n        \"offload_param\": {\n            \"device\": \"cpu\",\n            \"pin_memory\": True\n        },\n        \"overlap_comm\": True,\n        \"contiguous_gradients\": True,\n        \"reduce_bucket_size\": model_hidden_size * model_hidden_size,\n        \"stage3_prefetch_bucket_size\": 0.9 * model_hidden_size * model_hidden_size,\n        \"stage3_param_persistence_threshold\": 10 * model_hidden_size\n    },\n    \"steps_per_print\": 2000,\n    \"train_batch_size\": train_batch_size,\n    \"train_micro_batch_size_per_gpu\": 1,\n    \"wall_clock_breakdown\": False\n}\n# fmt: on\n\n# next line instructs transformers to partition the model directly over multiple gpus using\n# deepspeed.zero.Init when model's `from_pretrained` method is called.\n#\n# **it has to be run before loading the model AutoModelForSeq2SeqLM.from_pretrained(model_name)**\n#\n# otherwise the model will first be loaded normally and only partitioned at forward time which is\n# less efficient and when there is little CPU RAM may fail\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\n\n# now a model can be loaded.\nmodel = AutoModelForSeq2SeqLM.from_pretrained(model_name)\n\n# initialise Deepspeed ZeRO and store only the engine object\nds_engine = deepspeed.initialize(model=model, config_params=ds_config)[0]\nds_engine.module.eval()  # inference\n\n# Deepspeed ZeRO can process unrelated inputs on each GPU. So for 2 gpus you process 2 inputs at once.\n# If you use more GPUs adjust for more.\n# And of course if you have just one input to process you then need to pass the same string to both gpus\n# If you use only one GPU, then you will have only rank 0.\nrank = torch.distributed.get_rank()\nif rank == 0:\n    text_in = \"Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy\"\nelif rank == 1:\n    text_in = \"Is this review positive or negative?"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ddbb91b3-96c0-44f1-bbd5-5c8d0a10b405
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"ddbb91b3-96c0-44f1-bbd5-5c8d0a10b405\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e03d0f92-6011-4b7a-8041-445921534c51\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9b662c6fd94253a44e8a4070654f683818415240919573e0a1127de9bdf4d113\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"191e9e6b-4956-414a-b0c7-4149e1e5580a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6d6b78dfbb1294847f21e9191f445c51d71268caba472c165cafab67fc07bdc8\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 49919, \"end_char_idx\": 52815, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "#\n# **it has to be run before loading the model AutoModelForSeq2SeqLM.from_pretrained(model_name)**\n#\n# otherwise the model will first be loaded normally and only partitioned at forward time which is\n# less efficient and when there is little CPU RAM may fail\ndschf = HfDeepSpeedConfig(ds_config)  # keep this object alive\n\n# now a model can be loaded.\nmodel = AutoModelForSeq2SeqLM.from_pretrained(model_name)\n\n# initialise Deepspeed ZeRO and store only the engine object\nds_engine = deepspeed.initialize(model=model, config_params=ds_config)[0]\nds_engine.module.eval()  # inference\n\n# Deepspeed ZeRO can process unrelated inputs on each GPU. So for 2 gpus you process 2 inputs at once.\n# If you use more GPUs adjust for more.\n# And of course if you have just one input to process you then need to pass the same string to both gpus\n# If you use only one GPU, then you will have only rank 0.\nrank = torch.distributed.get_rank()\nif rank == 0:\n    text_in = \"Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy\"\nelif rank == 1:\n    text_in = \"Is this review positive or negative? Review: this is the worst restaurant ever\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_name)\ninputs = tokenizer.encode(text_in, return_tensors=\"pt\").to(device=local_rank)\nwith torch.no_grad():\n    outputs = ds_engine.module.generate(inputs, synced_gpus=True)\ntext_out = tokenizer.decode(outputs[0], skip_special_tokens=True)\nprint(f\"rank{rank}:\\n   in={text_in}\\n  out={text_out}\")\n```\n\nSave the script as t0.py and launch it:\n\n```bash\n$ deepspeed --num_gpus 2 t0.py\nrank0:\n   in=Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy\n  out=Positive\nrank1:\n   in=Is this review positive or negative? Review: this is the worst restaurant ever\n  out=negative\n```\n\nThis is a very basic example and you'll want to adapt it to your use case.\n\n### Generate\n\nUsing multiple GPUs with ZeRO-3 for generation requires synchronizing the GPUs by setting `synced_gpus=True` in the [`~GenerationMixin.generate`] method. Otherwise, if one GPU is finished generating before another one, the whole system hangs because the remaining GPUs haven't received the weight shard from the GPU that finished first.\n\nFor Transformers>=4.28, if `synced_gpus` is automatically set to `True` if multiple GPUs are detected during generation.\n\n## Troubleshoot\n\nWhen you encounter an issue, you should consider whether DeepSpeed is the cause of the problem because often it isn't (unless it's super obviously and you can see DeepSpeed modules in the exception)! The first step should be to retry your setup without DeepSpeed, and if the problem persists, then you can report the issue. If the issue is a core DeepSpeed problem and unrelated to the Transformers integration, open an Issue on the [DeepSpeed repository](https://github.com/microsoft/DeepSpeed)."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 191e9e6b-4956-414a-b0c7-4149e1e5580a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"191e9e6b-4956-414a-b0c7-4149e1e5580a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ddbb91b3-96c0-44f1-bbd5-5c8d0a10b405\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"c2142292c0a462fea1dad653954eb84d14651f0d0da7ac8d31388b31da70f423\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"03819fa5-4978-4ea2-b269-5a170c556be2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ed1c51766d2bd15f242f2e480c2ac869014719c80c6109070d5d6f4646b34ebe\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 51564, \"end_char_idx\": 54620, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Review: this is the best cast iron skillet you will ever buy\n  out=Positive\nrank1:\n   in=Is this review positive or negative? Review: this is the worst restaurant ever\n  out=negative\n```\n\nThis is a very basic example and you'll want to adapt it to your use case.\n\n### Generate\n\nUsing multiple GPUs with ZeRO-3 for generation requires synchronizing the GPUs by setting `synced_gpus=True` in the [`~GenerationMixin.generate`] method. Otherwise, if one GPU is finished generating before another one, the whole system hangs because the remaining GPUs haven't received the weight shard from the GPU that finished first.\n\nFor Transformers>=4.28, if `synced_gpus` is automatically set to `True` if multiple GPUs are detected during generation.\n\n## Troubleshoot\n\nWhen you encounter an issue, you should consider whether DeepSpeed is the cause of the problem because often it isn't (unless it's super obviously and you can see DeepSpeed modules in the exception)! The first step should be to retry your setup without DeepSpeed, and if the problem persists, then you can report the issue. If the issue is a core DeepSpeed problem and unrelated to the Transformers integration, open an Issue on the [DeepSpeed repository](https://github.com/microsoft/DeepSpeed).\n\nFor issues related to the Transformers integration, please provide the following information:\n\n* the full DeepSpeed config file\n\n* the command line arguments of the [`Trainer`], or [`TrainingArguments`] arguments if you're scripting the [`Trainer`] setup yourself (don't dump the [`TrainingArguments`] which has dozens of irrelevant entries)\n\n* the outputs of:\n\n```bash\npython -c 'import torch; print(f\"torch: {torch.__version__}\")'\npython -c 'import transformers; print(f\"transformers: {transformers.__version__}\")'\npython -c 'import deepspeed; print(f\"deepspeed: {deepspeed.__version__}\")'\n```\n\n* a link to a Google Colab notebook to reproduce the issue\n\n* if impossible, a standard and non-custom dataset we can use and also try to use an existing example to reproduce the issue with\n\nThe following sections provide a guide for resolving two of the most common issues.\n\n### DeepSpeed process killed at startup\n\nWhen the DeepSpeed process is killed during launch without a traceback, that usually means the program tried to allocate more CPU memory than your system has or your process tried to allocate more CPU memory than allowed leading the OS kernel to terminate the process. In this case, check whether your configuration file has either `offload_optimizer`, `offload_param` or both configured to offload to the CPU. \n\nIf you have NVMe and ZeRO-3 setup, experiment with offloading to the NVMe ([estimate](https://deepspeed.readthedocs.io/en/latest/memory.html) the memory requirements for your model).\n\n### NaN loss\n\nNaN loss often occurs when a model is pretrained in bf16 and then you try to use it with fp16 (especially relevant for TPU trained models). To resolve this, use fp32 or bf16 if your hardware supports it (TPU, Ampere GPUs or newer).\n\nThe other issue may be related to using fp16."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 03819fa5-4978-4ea2-b269-5a170c556be2
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"03819fa5-4978-4ea2-b269-5a170c556be2\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"191e9e6b-4956-414a-b0c7-4149e1e5580a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"badceb67d5bc29c3c06a7eb65487e63c741edf9482c872f6c03ff18cbdcec81e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"dab006ac-1570-4995-8405-c4947dfd3f3f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"155d9b4dc92b350674f861a8bc9dbf32eb14ce6e8be60d042b6ef57112deaee2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 53690, \"end_char_idx\": 56633, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "### DeepSpeed process killed at startup\n\nWhen the DeepSpeed process is killed during launch without a traceback, that usually means the program tried to allocate more CPU memory than your system has or your process tried to allocate more CPU memory than allowed leading the OS kernel to terminate the process. In this case, check whether your configuration file has either `offload_optimizer`, `offload_param` or both configured to offload to the CPU. \n\nIf you have NVMe and ZeRO-3 setup, experiment with offloading to the NVMe ([estimate](https://deepspeed.readthedocs.io/en/latest/memory.html) the memory requirements for your model).\n\n### NaN loss\n\nNaN loss often occurs when a model is pretrained in bf16 and then you try to use it with fp16 (especially relevant for TPU trained models). To resolve this, use fp32 or bf16 if your hardware supports it (TPU, Ampere GPUs or newer).\n\nThe other issue may be related to using fp16. For example, if this is your fp16 configuration:\n\n```yaml\n{\n    \"fp16\": {\n        \"enabled\": \"auto\",\n        \"loss_scale\": 0,\n        \"loss_scale_window\": 1000,\n        \"initial_scale_power\": 16,\n        \"hysteresis\": 2,\n        \"min_loss_scale\": 1\n    }\n}\n```\n\nYou might see the following `OVERFLOW!` messages in the logs:\n\n```bash\n0%|                                                                                                                             | 0/189 [00:00<?, ?it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 262144, reducing to 262144\n  1%|\u258c                                                                                                                    | 1/189 [00:00<01:26,  2.17it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 262144, reducing to 131072.0\n  1%|\u2588\u258f\n [...]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 14%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258c                                                                                                   | 27/189 [00:14<01:13,  2.21it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 15%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f                                                                                                  | 28/189 [00:14<01:13,  2.18it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 15%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258a                                                                                                  | 29/189 [00:15<01:13,  2.18it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n[...]\n```\n\nThis means the DeepSpeed loss scaler is unable to find a scaling coefficient to overcome loss overflow. To fix it, try a higher `initial_scale_power` value (32 usually works).\n\n## Resources\n\nDeepSpeed ZeRO is a powerful technology for training and loading very large models for inference with limited GPU resources, making it more accessible to everyone."}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: dab006ac-1570-4995-8405-c4947dfd3f3f
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/deepspeed", "title": "DeepSpeed", "tokens": 14117, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"dab006ac-1570-4995-8405-c4947dfd3f3f\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"5bbd5eaa-4763-4bb6-adc8-96053405c0c6\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"f49c03b668f2b0671b2660aa28b7bbb0a4c969e6e7b8a41806b02ed09c25a72e\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"03819fa5-4978-4ea2-b269-5a170c556be2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/deepspeed\", \"title\": \"DeepSpeed\", \"tokens\": 14117, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"596d3449f6afebf89c523a9b84043797e4a33bfa8af64cbb188220f7ff252b4c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 55130, \"end_char_idx\": 57280, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "ref_doc_id": "5bbd5eaa-4763-4bb6-adc8-96053405c0c6", "chroma:document": "Rank 0 Skipping step. Attempted loss scale: 262144, reducing to 262144\n  1%|\u258c                                                                                                                    | 1/189 [00:00<01:26,  2.17it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 262144, reducing to 131072.0\n  1%|\u2588\u258f\n [...]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 14%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258c                                                                                                   | 27/189 [00:14<01:13,  2.21it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 15%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258f                                                                                                  | 28/189 [00:14<01:13,  2.18it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n 15%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258a                                                                                                  | 29/189 [00:15<01:13,  2.18it/s]\n [deepscale] OVERFLOW! Rank 0 Skipping step. Attempted loss scale: 1, reducing to 1\n[...]\n```\n\nThis means the DeepSpeed loss scaler is unable to find a scaling coefficient to overcome loss overflow. To fix it, try a higher `initial_scale_power` value (32 usually works).\n\n## Resources\n\nDeepSpeed ZeRO is a powerful technology for training and loading very large models for inference with limited GPU resources, making it more accessible to everyone. To learn more about DeepSpeed, feel free to read the [blog posts](https://www.microsoft.com/en-us/research/search/?q=deepspeed), [documentation](https://www.deepspeed.ai/getting-started/), and [GitHub repository](https://github.com/microsoft/deepspeed). \n\nThe following papers are also a great resource for learning more about ZeRO:\n\n* [ZeRO: Memory Optimizations Toward Training Trillion Parameter Models](https://hf.co/papers/1910.02054)\n* [ZeRO-Offload: Democratizing Billion-Scale Model Training](https://hf.co/papers/2101.06840)\n* [ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning](https://hf.co/papers/2104.07857)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 30e4aa16-77cb-4efb-926f-a05ec5bcb73e
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"30e4aa16-77cb-4efb-926f-a05ec5bcb73e\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"413c3208-e79b-49bf-9253-e391fd1280b2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4bfdfc4013aa0effcda4de666acc0791525346a31cc0c328fa5f3c808473584d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 0, \"end_char_idx\": 3402, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "# \ud83e\udd17 Transformers\n\nState-of-the-art Machine Learning for [PyTorch](https://pytorch.org/), [TensorFlow](https://www.tensorflow.org/), and [JAX](https://jax.readthedocs.io/en/latest/).\n\n\ud83e\udd17 Transformers provides APIs and tools to easily download and train state-of-the-art pretrained models. Using pretrained models can reduce your compute costs, carbon footprint, and save you the time and resources required to train a model from scratch. These models support common tasks in different modalities, such as:\n\n\ud83d\udcdd **Natural Language Processing**: text classification, named entity recognition, question answering, language modeling, summarization, translation, multiple choice, and text generation.<br>\n\ud83d\uddbc\ufe0f **Computer Vision**: image classification, object detection, and segmentation.<br>\n\ud83d\udde3\ufe0f **Audio**: automatic speech recognition and audio classification.<br>\n\ud83d\udc19 **Multimodal**: table question answering, optical character recognition, information extraction from scanned documents, video classification, and visual question answering.\n\n\ud83e\udd17 Transformers support framework interoperability between PyTorch, TensorFlow, and JAX. This provides the flexibility to use a different framework at each stage of a model's life; train a model in three lines of code in one framework, and load it for inference in another. Models can also be exported to a format like ONNX and TorchScript for deployment in production environments.\n\nJoin the growing community on the [Hub](https://huggingface.co/models), [forum](https://discuss.huggingface.co/), or [Discord](https://discord.com/invite/JfAtkvEtRb) today!\n\n## If you are looking for custom support from the Hugging Face team\n\n<a target=\"_blank\" href=\"https://huggingface.co/support\">\n    <img alt=\"HuggingFace Expert Acceleration Program\" src=\"https://cdn-media.huggingface.co/marketing/transformers/new-support-improved.png\" style=\"width: 100%; max-width: 600px; border: 1px solid #eee; border-radius: 4px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\">\n</a>\n\n## Contents\n\nThe documentation is organized into five sections:\n\n- **GET STARTED** provides a quick tour of the library and installation instructions to get up and running.\n- **TUTORIALS** are a great place to start if you're a beginner. This section will help you gain the basic skills you need to start using the library.\n- **HOW-TO GUIDES** show you how to achieve a specific goal, like finetuning a pretrained model for language modeling or how to write and share a custom model.\n- **CONCEPTUAL GUIDES** offers more discussion and explanation of the underlying concepts and ideas behind models, tasks, and the design philosophy of \ud83e\udd17 Transformers.\n- **API** describes all classes and functions:\n\n  - **MAIN CLASSES** details the most important classes like configuration, model, tokenizer, and pipeline.\n  - **MODELS** details the classes and functions related to each model implemented in the library.\n  - **INTERNAL HELPERS** details utility classes and functions used internally.\n\n\n## Supported models and frameworks\n\nThe table below represents the current support in the library for each of those models, whether they have a Python\ntokenizer (called \"slow\"). A \"fast\" tokenizer backed by the \ud83e\udd17 Tokenizers library, whether they have support in Jax (via\nFlax), PyTorch, and/or TensorFlow.\n\n<!--This table is updated automatically from the auto modules with _make fix-copies_. Do not update manually!-->\n\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 413c3208-e79b-49bf-9253-e391fd1280b2
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"413c3208-e79b-49bf-9253-e391fd1280b2\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"30e4aa16-77cb-4efb-926f-a05ec5bcb73e\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"1a88f4d3ebfda474b1dcd6e67cd2573c21778fe7b4e724135f5e1afabb9d507b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"defe35de-8a6a-4060-b625-f582dc3a91a9\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f27304428015a00f0abdcb613b12ffafc4fff0501c11620868838b817f9331ba\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 2980, \"end_char_idx\": 4432, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "## Supported models and frameworks\n\nThe table below represents the current support in the library for each of those models, whether they have a Python\ntokenizer (called \"slow\"). A \"fast\" tokenizer backed by the \ud83e\udd17 Tokenizers library, whether they have support in Jax (via\nFlax), PyTorch, and/or TensorFlow.\n\n<!--This table is updated automatically from the auto modules with _make fix-copies_. Do not update manually!-->\n\n|                                  Model                                   | PyTorch support | TensorFlow support | Flax Support |\n|:------------------------------------------------------------------------:|:---------------:|:------------------:|:------------:|\n|                        [ALBERT](model_doc/albert)                        |       \u2705        |         \u2705         |      \u2705      |\n|                         [ALIGN](model_doc/align)                         |       \u2705        |         \u274c         |      \u274c      |\n|                       [AltCLIP](model_doc/altclip)                       |       \u2705        |         \u274c         |      \u274c      |\n| [Audio Spectrogram Transformer](model_doc/audio-spectrogram-transformer) |       \u2705        |         \u274c         |      \u274c      |\n|                    [Autoformer](model_doc/autoformer)                    |       \u2705        |         \u274c         |      \u274c      |\n|                          [Bark](model_doc/bark)                          |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: defe35de-8a6a-4060-b625-f582dc3a91a9
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"defe35de-8a6a-4060-b625-f582dc3a91a9\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"413c3208-e79b-49bf-9253-e391fd1280b2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"8ce74e2578721fb713d916aa1c23259f5a59ff2171dd3e62b492dac6d526c189\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5577f61f-0605-43b9-8356-2107aa67b6ba\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4a4e2d17774019d9d6b8b094a0602bb8f9a3b4c573f0fdb6db3c149072e06daf\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 3903, \"end_char_idx\": 4899, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|      \u274c      |\n|                       [AltCLIP](model_doc/altclip)                       |       \u2705        |         \u274c         |      \u274c      |\n| [Audio Spectrogram Transformer](model_doc/audio-spectrogram-transformer) |       \u2705        |         \u274c         |      \u274c      |\n|                    [Autoformer](model_doc/autoformer)                    |       \u2705        |         \u274c         |      \u274c      |\n|                          [Bark](model_doc/bark)                          |       \u2705        |         \u274c         |      \u274c      |\n|                          [BART](model_doc/bart)                          |       \u2705        |         \u2705         |      \u2705      |\n|                       [BARThez](model_doc/barthez)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [BARTpho](model_doc/bartpho)                       |       \u2705        |         \u2705         |      \u2705      |\n|                          [BEiT](model_doc/beit)                          |       \u2705"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 5577f61f-0605-43b9-8356-2107aa67b6ba
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"5577f61f-0605-43b9-8356-2107aa67b6ba\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"defe35de-8a6a-4060-b625-f582dc3a91a9\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"c678dbf601eeab09e98c185daba2cf7305046b194bf3fdc435a3453f05686c1d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f607a085-a865-4551-8544-9266a0851ce2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4aab148442de04f6fce0fd7e9ca3c6dea2a5967a2571c2dc3da598c9751dbb4c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4422, \"end_char_idx\": 5403, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u274c      |\n|                          [BART](model_doc/bart)                          |       \u2705        |         \u2705         |      \u2705      |\n|                       [BARThez](model_doc/barthez)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [BARTpho](model_doc/bartpho)                       |       \u2705        |         \u2705         |      \u2705      |\n|                          [BEiT](model_doc/beit)                          |       \u2705        |         \u274c         |      \u2705      |\n|                          [BERT](model_doc/bert)                          |       \u2705        |         \u2705         |      \u2705      |\n|               [Bert Generation](model_doc/bert-generation)               |       \u2705        |         \u274c         |      \u274c      |\n|                 [BertJapanese](model_doc/bert-japanese)                  |       \u2705        |         \u2705         |      \u2705      |\n|                      [BERTweet](model_doc/bertweet)                      |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: f607a085-a865-4551-8544-9266a0851ce2
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"f607a085-a865-4551-8544-9266a0851ce2\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5577f61f-0605-43b9-8356-2107aa67b6ba\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"a1f6bf741a73fcdc428f3d6feb376b82f442c72a4ee085ff096f50e3a262e936\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"8a46c85c-2e44-4399-ba12-b1bde9fe7a99\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"5c3e2363b670e447da6b96644ff5425e5fccfea6058b06611b99cff3a31a68d3\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 4890, \"end_char_idx\": 5887, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u2705      |\n|                          [BERT](model_doc/bert)                          |       \u2705        |         \u2705         |      \u2705      |\n|               [Bert Generation](model_doc/bert-generation)               |       \u2705        |         \u274c         |      \u274c      |\n|                 [BertJapanese](model_doc/bert-japanese)                  |       \u2705        |         \u2705         |      \u2705      |\n|                      [BERTweet](model_doc/bertweet)                      |       \u2705        |         \u2705         |      \u2705      |\n|                      [BigBird](model_doc/big_bird)                       |       \u2705        |         \u274c         |      \u2705      |\n|               [BigBird-Pegasus](model_doc/bigbird_pegasus)               |       \u2705        |         \u274c         |      \u274c      |\n|                        [BioGpt](model_doc/biogpt)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [BiT](model_doc/bit)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 8a46c85c-2e44-4399-ba12-b1bde9fe7a99
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"8a46c85c-2e44-4399-ba12-b1bde9fe7a99\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f607a085-a865-4551-8544-9266a0851ce2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"27990e438d3790491785f00076a18e2d44ec3071bc47f2a9613762f503283752\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"345ac1a9-1ee5-4bb7-a65b-f6e1dd8aae11\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"71aa929b084f1a39d702979d6228d3879478f78d69364613be36c4075c4b455e\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5402, \"end_char_idx\": 6352, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u2705         |      \u2705      |\n|                      [BigBird](model_doc/big_bird)                       |       \u2705        |         \u274c         |      \u2705      |\n|               [BigBird-Pegasus](model_doc/bigbird_pegasus)               |       \u2705        |         \u274c         |      \u274c      |\n|                        [BioGpt](model_doc/biogpt)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [BiT](model_doc/bit)                           |       \u2705        |         \u274c         |      \u274c      |\n|                    [Blenderbot](model_doc/blenderbot)                    |       \u2705        |         \u2705         |      \u2705      |\n|              [BlenderbotSmall](model_doc/blenderbot-small)               |       \u2705        |         \u2705         |      \u2705      |\n|                          [BLIP](model_doc/blip)                          |       \u2705        |         \u2705         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 345ac1a9-1ee5-4bb7-a65b-f6e1dd8aae11
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"345ac1a9-1ee5-4bb7-a65b-f6e1dd8aae11\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"8a46c85c-2e44-4399-ba12-b1bde9fe7a99\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"a39d501ed65d14e062394b747b219912e1963d1ac3e31399da016b463c671003\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d327ea9f-df30-4da6-a438-464c42acf2dc\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e74e6a1e66f5c2bc11e7005ddf2136034bdac6165c77c25da7a54664c7241e24\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 5867, \"end_char_idx\": 6838, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[BiT](model_doc/bit)                           |       \u2705        |         \u274c         |      \u274c      |\n|                    [Blenderbot](model_doc/blenderbot)                    |       \u2705        |         \u2705         |      \u2705      |\n|              [BlenderbotSmall](model_doc/blenderbot-small)               |       \u2705        |         \u2705         |      \u2705      |\n|                          [BLIP](model_doc/blip)                          |       \u2705        |         \u2705         |      \u274c      |\n|                        [BLIP-2](model_doc/blip-2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                         [BLOOM](model_doc/bloom)                         |       \u2705        |         \u274c         |      \u2705      |\n|                          [BORT](model_doc/bort)                          |       \u2705        |         \u2705         |      \u2705      |\n|                   [BridgeTower](model_doc/bridgetower)                   |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: d327ea9f-df30-4da6-a438-464c42acf2dc
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"d327ea9f-df30-4da6-a438-464c42acf2dc\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"345ac1a9-1ee5-4bb7-a65b-f6e1dd8aae11\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"bbf3e5f65346b3ab61cb38aea5634d2a8b0a46d51f0c63abce8b7c5b07cafa50\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"62525ed4-a424-4010-8674-f747babb45a6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b2dd56751727902fa53c459d46c7a889fdf5b4c16c62fc0c4f83c4879b7b88d2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6376, \"end_char_idx\": 7298, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[BLIP-2](model_doc/blip-2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                         [BLOOM](model_doc/bloom)                         |       \u2705        |         \u274c         |      \u2705      |\n|                          [BORT](model_doc/bort)                          |       \u2705        |         \u2705         |      \u2705      |\n|                   [BridgeTower](model_doc/bridgetower)                   |       \u2705        |         \u274c         |      \u274c      |\n|                          [BROS](model_doc/bros)                          |       \u2705        |         \u274c         |      \u274c      |\n|                          [ByT5](model_doc/byt5)                          |       \u2705        |         \u2705         |      \u2705      |\n|                     [CamemBERT](model_doc/camembert)                     |       \u2705        |         \u2705         |      \u274c      |\n|                        [CANINE](model_doc/canine)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 62525ed4-a424-4010-8674-f747babb45a6
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"62525ed4-a424-4010-8674-f747babb45a6\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d327ea9f-df30-4da6-a438-464c42acf2dc\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"e2b33adaf81ead8291cc018116c843c44270d2949e34847223c14fb3cb878274\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"57f61a2c-0140-4297-85ef-b90e0f80fbed\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4cbf91152004a90e036da288176f074f384967efb5baa74fdcab13d3ec8f5d25\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 6827, \"end_char_idx\": 7760, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                          [BROS](model_doc/bros)                          |       \u2705        |         \u274c         |      \u274c      |\n|                          [ByT5](model_doc/byt5)                          |       \u2705        |         \u2705         |      \u2705      |\n|                     [CamemBERT](model_doc/camembert)                     |       \u2705        |         \u2705         |      \u274c      |\n|                        [CANINE](model_doc/canine)                        |       \u2705        |         \u274c         |      \u274c      |\n|                     [Chameleon](model_doc/chameleon)                     |       \u2705        |         \u274c         |      \u274c      |\n|                  [Chinese-CLIP](model_doc/chinese_clip)                  |       \u2705        |         \u274c         |      \u274c      |\n|                          [CLAP](model_doc/clap)                          |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 57f61a2c-0140-4297-85ef-b90e0f80fbed
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"57f61a2c-0140-4297-85ef-b90e0f80fbed\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"62525ed4-a424-4010-8674-f747babb45a6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"575d3338705bd3b29f247dd3f5136a03e3a1c7488139a0796b1dc8827040ebfd\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"e8028b6c-10d9-4e9b-bbe2-a5b8beb06875\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4a0f4abfcf30f08b776cedba1cd38b68ecd5c270266a7a1498278a3dba20ee8e\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7322, \"end_char_idx\": 8246, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                     [Chameleon](model_doc/chameleon)                     |       \u2705        |         \u274c         |      \u274c      |\n|                  [Chinese-CLIP](model_doc/chinese_clip)                  |       \u2705        |         \u274c         |      \u274c      |\n|                          [CLAP](model_doc/clap)                          |       \u2705        |         \u274c         |      \u274c      |\n|                          [CLIP](model_doc/clip)                          |       \u2705        |         \u2705         |      \u2705      |\n|                       [CLIPSeg](model_doc/clipseg)                       |       \u2705        |         \u274c         |      \u274c      |\n|                          [CLVP](model_doc/clvp)                          |       \u2705        |         \u274c         |      \u274c      |\n|                       [CodeGen](model_doc/codegen)                       |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: e8028b6c-10d9-4e9b-bbe2-a5b8beb06875
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"e8028b6c-10d9-4e9b-bbe2-a5b8beb06875\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"57f61a2c-0140-4297-85ef-b90e0f80fbed\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"1d16c36921c76fa9c81ccd95334deacbac506b7239d0ea854e9da20355f7a5b7\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a4c43eb1-d01f-45e7-98a1-1bdfff39ae5c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"9178f9e3f21e46b64e96628c8067bbac6d78b7dfa7bb76712a919c48a2d1f5c1\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 7786, \"end_char_idx\": 8748, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[CLIP](model_doc/clip)                          |       \u2705        |         \u2705         |      \u2705      |\n|                       [CLIPSeg](model_doc/clipseg)                       |       \u2705        |         \u274c         |      \u274c      |\n|                          [CLVP](model_doc/clvp)                          |       \u2705        |         \u274c         |      \u274c      |\n|                       [CodeGen](model_doc/codegen)                       |       \u2705        |         \u274c         |      \u274c      |\n|                    [CodeLlama](model_doc/code_llama)                     |       \u2705        |         \u274c         |      \u2705      |\n|                        [Cohere](model_doc/cohere)                        |       \u2705        |         \u274c         |      \u274c      |\n|              [Conditional DETR](model_doc/conditional_detr)              |       \u2705        |         \u274c         |      \u274c      |\n|                      [ConvBERT](model_doc/convbert)                      |       \u2705        |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a4c43eb1-d01f-45e7-98a1-1bdfff39ae5c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a4c43eb1-d01f-45e7-98a1-1bdfff39ae5c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"e8028b6c-10d9-4e9b-bbe2-a5b8beb06875\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"32a9d7a97571bf13b55101ab59c1913c10236644635f46b7b3470fed8e61c345\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"2b629d82-c660-4c8f-b041-761073811472\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"2a4f7c252c21c51954fc0b18ec19f6e3295db3965d9d2e47219bdb643c984fa2\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8245, \"end_char_idx\": 9218, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u274c         |      \u274c      |\n|                    [CodeLlama](model_doc/code_llama)                     |       \u2705        |         \u274c         |      \u2705      |\n|                        [Cohere](model_doc/cohere)                        |       \u2705        |         \u274c         |      \u274c      |\n|              [Conditional DETR](model_doc/conditional_detr)              |       \u2705        |         \u274c         |      \u274c      |\n|                      [ConvBERT](model_doc/convbert)                      |       \u2705        |         \u2705         |      \u274c      |\n|                      [ConvNeXT](model_doc/convnext)                      |       \u2705        |         \u2705         |      \u274c      |\n|                    [ConvNeXTV2](model_doc/convnextv2)                    |       \u2705        |         \u2705         |      \u274c      |\n|                           [CPM](model_doc/cpm)                           |       \u2705        |         \u2705         |      \u2705      |\n|                       [CPM-Ant](model_doc/cpmant)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 2b629d82-c660-4c8f-b041-761073811472
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"2b629d82-c660-4c8f-b041-761073811472\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a4c43eb1-d01f-45e7-98a1-1bdfff39ae5c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"a6d572eca60573af9674354fcfb2c07b2fa999537f193653c40c4c0c6030bba3\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"4d1f5583-5a15-45a9-895e-12c03b3f4b69\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"72eb6b26eb75a5feb7f75b7cef29a99a68b733446b70a8e014653c2351b54429\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 8747, \"end_char_idx\": 9671, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u2705         |      \u274c      |\n|                      [ConvNeXT](model_doc/convnext)                      |       \u2705        |         \u2705         |      \u274c      |\n|                    [ConvNeXTV2](model_doc/convnextv2)                    |       \u2705        |         \u2705         |      \u274c      |\n|                           [CPM](model_doc/cpm)                           |       \u2705        |         \u2705         |      \u2705      |\n|                       [CPM-Ant](model_doc/cpmant)                        |       \u2705        |         \u274c         |      \u274c      |\n|                          [CTRL](model_doc/ctrl)                          |       \u2705        |         \u2705         |      \u274c      |\n|                           [CvT](model_doc/cvt)                           |       \u2705        |         \u2705         |      \u274c      |\n|                           [DAC](model_doc/dac)                           |       \u2705        |         \u274c         |      \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 4d1f5583-5a15-45a9-895e-12c03b3f4b69
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"4d1f5583-5a15-45a9-895e-12c03b3f4b69\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"2b629d82-c660-4c8f-b041-761073811472\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"61c3ddfe0a41b2171fee2933d9f3624fd2be3a51989779c7f422767bf53a571b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"cd69eec9-7fe1-4f78-8066-cb71fa360a91\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"146338ee34189f094dba32544f9794d74be6a2d87b78e1895fb7f8e56c4467b4\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9242, \"end_char_idx\": 10166, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                          [CTRL](model_doc/ctrl)                          |       \u2705        |         \u2705         |      \u274c      |\n|                           [CvT](model_doc/cvt)                           |       \u2705        |         \u2705         |      \u274c      |\n|                           [DAC](model_doc/dac)                           |       \u2705        |         \u274c         |      \u274c      |\n|                   [Data2VecAudio](model_doc/data2vec)                    |       \u2705        |         \u274c         |      \u274c      |\n|                    [Data2VecText](model_doc/data2vec)                    |       \u2705        |         \u274c         |      \u274c      |\n|                   [Data2VecVision](model_doc/data2vec)                   |       \u2705        |         \u2705         |      \u274c      |\n|                          [DBRX](model_doc/dbrx)                          |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: cd69eec9-7fe1-4f78-8066-cb71fa360a91
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"cd69eec9-7fe1-4f78-8066-cb71fa360a91\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4d1f5583-5a15-45a9-895e-12c03b3f4b69\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"46c08edcf8b3b6bbc7fc1e7b9e61e1e939b1f0ca7da0b57d54aee09745b5a287\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a58bd46b-7ddc-490c-bc56-f9a13c9a640a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"25b357628f290774fda03ef2c2757843387ef442727c4a691a54e7603757171a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 9663, \"end_char_idx\": 10678, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|      \u274c      |\n|                   [Data2VecAudio](model_doc/data2vec)                    |       \u2705        |         \u274c         |      \u274c      |\n|                    [Data2VecText](model_doc/data2vec)                    |       \u2705        |         \u274c         |      \u274c      |\n|                   [Data2VecVision](model_doc/data2vec)                   |       \u2705        |         \u2705         |      \u274c      |\n|                          [DBRX](model_doc/dbrx)                          |       \u2705        |         \u274c         |      \u274c      |\n|                       [DeBERTa](model_doc/deberta)                       |       \u2705        |         \u2705         |      \u274c      |\n|                    [DeBERTa-v2](model_doc/deberta-v2)                    |       \u2705        |         \u2705         |      \u274c      |\n|          [Decision Transformer](model_doc/decision_transformer)          |       \u2705        |         \u274c         |      \u274c      |\n|               [Deformable DETR](model_doc/deformable_detr)               |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a58bd46b-7ddc-490c-bc56-f9a13c9a640a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a58bd46b-7ddc-490c-bc56-f9a13c9a640a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"cd69eec9-7fe1-4f78-8066-cb71fa360a91\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"ab8cb4b3690123e733282f66515113f23ac7b8383f9611473dfd3d8287cb8988\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"9562b85b-a1f4-4193-8ed7-f977a5358b32\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e479cbe608b86ceee5abc8877dcd4dbd55c265fadb0eefbee6411085ea38ac74\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10155, \"end_char_idx\": 11163, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                       [DeBERTa](model_doc/deberta)                       |       \u2705        |         \u2705         |      \u274c      |\n|                    [DeBERTa-v2](model_doc/deberta-v2)                    |       \u2705        |         \u2705         |      \u274c      |\n|          [Decision Transformer](model_doc/decision_transformer)          |       \u2705        |         \u274c         |      \u274c      |\n|               [Deformable DETR](model_doc/deformable_detr)               |       \u2705        |         \u274c         |      \u274c      |\n|                          [DeiT](model_doc/deit)                          |       \u2705        |         \u2705         |      \u274c      |\n|                        [DePlot](model_doc/deplot)                        |       \u2705        |         \u274c         |      \u274c      |\n|                [Depth Anything](model_doc/depth_anything)                |       \u2705        |         \u274c         |      \u274c      |\n|                          [DETA](model_doc/deta)                          |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 9562b85b-a1f4-4193-8ed7-f977a5358b32
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"9562b85b-a1f4-4193-8ed7-f977a5358b32\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a58bd46b-7ddc-490c-bc56-f9a13c9a640a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"15b7cb362054a2759c1c0d32016ad0c0bc5d085ef01cfe8d334117cecf386b03\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"2408f6a0-a66f-4bda-bd44-0a2135a0a8b9\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b34a36b2f72f6edba77d75b6ba80047f9bc0b69cc024728a1da61013117f4d4c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 10677, \"end_char_idx\": 11600, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u274c         |      \u274c      |\n|                          [DeiT](model_doc/deit)                          |       \u2705        |         \u2705         |      \u274c      |\n|                        [DePlot](model_doc/deplot)                        |       \u2705        |         \u274c         |      \u274c      |\n|                [Depth Anything](model_doc/depth_anything)                |       \u2705        |         \u274c         |      \u274c      |\n|                          [DETA](model_doc/deta)                          |       \u2705        |         \u274c         |      \u274c      |\n|                          [DETR](model_doc/detr)                          |       \u2705        |         \u274c         |      \u274c      |\n|                      [DialoGPT](model_doc/dialogpt)                      |       \u2705        |         \u2705         |      \u2705      |\n|                         [DiNAT](model_doc/dinat)                         |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 2408f6a0-a66f-4bda-bd44-0a2135a0a8b9
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"2408f6a0-a66f-4bda-bd44-0a2135a0a8b9\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"9562b85b-a1f4-4193-8ed7-f977a5358b32\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"ebd432f1f04f63ea76c8f999b5385f9c43f4392db23414a3baee044a9616d9ba\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"d05afd92-2be2-430f-afdd-4c2df68abd2d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"f956cd909d2987f06c57eca4c02f46f0a659eb6fe69e5f0f951473447c6208b4\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 11162, \"end_char_idx\": 12086, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                          [DETR](model_doc/detr)                          |       \u2705        |         \u274c         |      \u274c      |\n|                      [DialoGPT](model_doc/dialogpt)                      |       \u2705        |         \u2705         |      \u2705      |\n|                         [DiNAT](model_doc/dinat)                         |       \u2705        |         \u274c         |      \u274c      |\n|                        [DINOv2](model_doc/dinov2)                        |       \u2705        |         \u274c         |      \u2705      |\n|                    [DistilBERT](model_doc/distilbert)                    |       \u2705        |         \u2705         |      \u2705      |\n|                           [DiT](model_doc/dit)                           |       \u2705        |         \u274c         |      \u2705      |\n|                       [DonutSwin](model_doc/donut)                       |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: d05afd92-2be2-430f-afdd-4c2df68abd2d
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"d05afd92-2be2-430f-afdd-4c2df68abd2d\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"2408f6a0-a66f-4bda-bd44-0a2135a0a8b9\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"0b56b37bc44b9b15a2b2a463a1935a667e54356a89c1ffc410e8b75e372ff06e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"1530ca5d-f76a-432c-aeba-70ca14e0984b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"1cf2701173afdda54b152b6bfe514461d89b93984fe6955fac19a3accbfea78f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 11624, \"end_char_idx\": 12579, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[DINOv2](model_doc/dinov2)                        |       \u2705        |         \u274c         |      \u2705      |\n|                    [DistilBERT](model_doc/distilbert)                    |       \u2705        |         \u2705         |      \u2705      |\n|                           [DiT](model_doc/dit)                           |       \u2705        |         \u274c         |      \u2705      |\n|                       [DonutSwin](model_doc/donut)                       |       \u2705        |         \u274c         |      \u274c      |\n|                           [DPR](model_doc/dpr)                           |       \u2705        |         \u2705         |      \u274c      |\n|                           [DPT](model_doc/dpt)                           |       \u2705        |         \u274c         |      \u274c      |\n|               [EfficientFormer](model_doc/efficientformer)               |       \u2705        |         \u2705         |      \u274c      |\n|                  [EfficientNet](model_doc/efficientnet)                  |       \u2705"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 1530ca5d-f76a-432c-aeba-70ca14e0984b
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"1530ca5d-f76a-432c-aeba-70ca14e0984b\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"d05afd92-2be2-430f-afdd-4c2df68abd2d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"7754e7dcd12d86863e8f5b126243fb71142085e96d0954c4170419ff998cabde\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5f84b30a-3af8-486e-abb7-122c782397ee\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"b43490eb9793c6a2b8479c961ec8b544493367769508baab685017e58905ab80\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12085, \"end_char_idx\": 13057, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u274c         |      \u274c      |\n|                           [DPR](model_doc/dpr)                           |       \u2705        |         \u2705         |      \u274c      |\n|                           [DPT](model_doc/dpt)                           |       \u2705        |         \u274c         |      \u274c      |\n|               [EfficientFormer](model_doc/efficientformer)               |       \u2705        |         \u2705         |      \u274c      |\n|                  [EfficientNet](model_doc/efficientnet)                  |       \u2705        |         \u274c         |      \u274c      |\n|                       [ELECTRA](model_doc/electra)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [EnCodec](model_doc/encodec)                       |       \u2705        |         \u274c         |      \u274c      |\n|               [Encoder decoder](model_doc/encoder-decoder)               |       \u2705        |         \u2705         |      \u2705      |\n|                         [ERNIE](model_doc/ernie)"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 5f84b30a-3af8-486e-abb7-122c782397ee
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"5f84b30a-3af8-486e-abb7-122c782397ee\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"1530ca5d-f76a-432c-aeba-70ca14e0984b\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"dfb48eeaafd3b2ff300e21d75cf1b5a96fc940b20e8d5102f619eb7515ba2a0d\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"783093db-90d4-4c57-86f8-2c217075e83a\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"ba06dfc450c8a640406eaadec0d5acab416ac291290f559eadf66ed9b71010f9\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 12578, \"end_char_idx\": 13520, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u2705        |         \u274c         |      \u274c      |\n|                       [ELECTRA](model_doc/electra)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [EnCodec](model_doc/encodec)                       |       \u2705        |         \u274c         |      \u274c      |\n|               [Encoder decoder](model_doc/encoder-decoder)               |       \u2705        |         \u2705         |      \u2705      |\n|                         [ERNIE](model_doc/ernie)                         |       \u2705        |         \u274c         |      \u274c      |\n|                       [ErnieM](model_doc/ernie_m)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [ESM](model_doc/esm)                           |       \u2705        |         \u2705         |      \u274c      |\n|              [FairSeq Machine-Translation](model_doc/fsmt)               |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 783093db-90d4-4c57-86f8-2c217075e83a
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"783093db-90d4-4c57-86f8-2c217075e83a\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5f84b30a-3af8-486e-abb7-122c782397ee\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"6893049ea68f2c689f2ed1748cec6cc5b176b6d20242e663362c6d030ad28b53\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"f7575cca-9bc3-4a02-b253-0a8f67a53355\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"817a83d55e6cf71248d8786a8e5dedc38a3e2ed02756b5b9c67e1026a39c216f\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13082, \"end_char_idx\": 14032, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                       [ErnieM](model_doc/ernie_m)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [ESM](model_doc/esm)                           |       \u2705        |         \u2705         |      \u274c      |\n|              [FairSeq Machine-Translation](model_doc/fsmt)               |       \u2705        |         \u274c         |      \u274c      |\n|                        [Falcon](model_doc/falcon)                        |       \u2705        |         \u274c         |      \u274c      |\n|                  [FalconMamba](model_doc/falcon_mamba)                   |       \u2705        |         \u274c         |      \u274c      |\n|         [FastSpeech2Conformer](model_doc/fastspeech2_conformer)          |       \u2705        |         \u274c         |      \u274c      |\n|                       [FLAN-T5](model_doc/flan-t5)                       |       \u2705        |         \u2705         |      \u2705      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: f7575cca-9bc3-4a02-b253-0a8f67a53355
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"f7575cca-9bc3-4a02-b253-0a8f67a53355\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"783093db-90d4-4c57-86f8-2c217075e83a\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"bdad54499e8229c2cef66535f32ebfdc292898eb130b8f1f458abab950e37545\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"cefba0f5-acec-4509-940e-76746d2557a2\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"6722b6f60bd608143ba7b00a077a120040f079ce8ab17f595544dfcb947514dc\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 13544, \"end_char_idx\": 14518, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[Falcon](model_doc/falcon)                        |       \u2705        |         \u274c         |      \u274c      |\n|                  [FalconMamba](model_doc/falcon_mamba)                   |       \u2705        |         \u274c         |      \u274c      |\n|         [FastSpeech2Conformer](model_doc/fastspeech2_conformer)          |       \u2705        |         \u274c         |      \u274c      |\n|                       [FLAN-T5](model_doc/flan-t5)                       |       \u2705        |         \u2705         |      \u2705      |\n|                      [FLAN-UL2](model_doc/flan-ul2)                      |       \u2705        |         \u2705         |      \u2705      |\n|                      [FlauBERT](model_doc/flaubert)                      |       \u2705        |         \u2705         |      \u274c      |\n|                         [FLAVA](model_doc/flava)                         |       \u2705        |         \u274c         |      \u274c      |\n|                          [FNet](model_doc/fnet)                          |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: cefba0f5-acec-4509-940e-76746d2557a2
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"cefba0f5-acec-4509-940e-76746d2557a2\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"f7575cca-9bc3-4a02-b253-0a8f67a53355\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"a10a13be1f29d6735da52fc98a37372866c40a032d3811e499e92a6e2b1a5ac9\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"7a6235a6-399d-4107-b004-9f5f7c26a0c4\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"c62dacd6c8334f153fb423e48d39febdda9d69a426f37caf2c644385f2997d3d\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 14054, \"end_char_idx\": 15003, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[FLAN-UL2](model_doc/flan-ul2)                      |       \u2705        |         \u2705         |      \u2705      |\n|                      [FlauBERT](model_doc/flaubert)                      |       \u2705        |         \u2705         |      \u274c      |\n|                         [FLAVA](model_doc/flava)                         |       \u2705        |         \u274c         |      \u274c      |\n|                          [FNet](model_doc/fnet)                          |       \u2705        |         \u274c         |      \u274c      |\n|                      [FocalNet](model_doc/focalnet)                      |       \u2705        |         \u274c         |      \u274c      |\n|                  [Funnel Transformer](model_doc/funnel)                  |       \u2705        |         \u2705         |      \u274c      |\n|                          [Fuyu](model_doc/fuyu)                          |       \u2705        |         \u274c         |      \u274c      |\n|                         [Gemma](model_doc/gemma)                         |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 7a6235a6-399d-4107-b004-9f5f7c26a0c4
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"7a6235a6-399d-4107-b004-9f5f7c26a0c4\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"cefba0f5-acec-4509-940e-76746d2557a2\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9ff1d72d0588a6d949748d3414cc26ffabe4127e978b89f352dbab9530b53c8b\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"9395be22-9e57-4bfd-9d7a-6430b1b4f6c9\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"835a3d5f40d2c71d06daa7164287f651afdeccc8477cec9b8fc3699dd59493ab\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 14507, \"end_char_idx\": 15440, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                      [FocalNet](model_doc/focalnet)                      |       \u2705        |         \u274c         |      \u274c      |\n|                  [Funnel Transformer](model_doc/funnel)                  |       \u2705        |         \u2705         |      \u274c      |\n|                          [Fuyu](model_doc/fuyu)                          |       \u2705        |         \u274c         |      \u274c      |\n|                         [Gemma](model_doc/gemma)                         |       \u2705        |         \u274c         |      \u2705      |\n|                        [Gemma2](model_doc/gemma2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [GIT](model_doc/git)                           |       \u2705        |         \u274c         |      \u274c      |\n|                          [GLPN](model_doc/glpn)                          |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 9395be22-9e57-4bfd-9d7a-6430b1b4f6c9
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"9395be22-9e57-4bfd-9d7a-6430b1b4f6c9\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"7a6235a6-399d-4107-b004-9f5f7c26a0c4\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9678bd93c72034a6dd8f26c67835c41bfe321727a261b24eb76c2c59b3a7ae45\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"675ebdfb-ea3d-4298-a176-65063e0c6128\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"0e09258f755c5221efb430967efc0525bdf0ec1a8aa0d998d853780c17b6f93a\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 15002, \"end_char_idx\": 15936, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u2705      |\n|                        [Gemma2](model_doc/gemma2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                           [GIT](model_doc/git)                           |       \u2705        |         \u274c         |      \u274c      |\n|                          [GLPN](model_doc/glpn)                          |       \u2705        |         \u274c         |      \u274c      |\n|                       [GPT Neo](model_doc/gpt_neo)                       |       \u2705        |         \u274c         |      \u2705      |\n|                      [GPT NeoX](model_doc/gpt_neox)                      |       \u2705        |         \u274c         |      \u274c      |\n|             [GPT NeoX Japanese](model_doc/gpt_neox_japanese)             |       \u2705        |         \u274c         |      \u274c      |\n|                         [GPT-J](model_doc/gptj)                          |       \u2705        |         \u2705         |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 675ebdfb-ea3d-4298-a176-65063e0c6128
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"675ebdfb-ea3d-4298-a176-65063e0c6128\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"9395be22-9e57-4bfd-9d7a-6430b1b4f6c9\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"b1dc8c0f7c352e8facade29e11c6f9fad44aa07f8025a0ac59658057f21a8cee\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"5930b80b-750e-441d-a0b0-016a85c0c998\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"818de82d31a5db6ee0f451db70bcaab7e444762fcfffc4c24c0c200043d328cc\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 15463, \"end_char_idx\": 16428, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[GPT Neo](model_doc/gpt_neo)                       |       \u2705        |         \u274c         |      \u2705      |\n|                      [GPT NeoX](model_doc/gpt_neox)                      |       \u2705        |         \u274c         |      \u274c      |\n|             [GPT NeoX Japanese](model_doc/gpt_neox_japanese)             |       \u2705        |         \u274c         |      \u274c      |\n|                         [GPT-J](model_doc/gptj)                          |       \u2705        |         \u2705         |      \u2705      |\n|                       [GPT-Sw3](model_doc/gpt-sw3)                       |       \u2705        |         \u2705         |      \u2705      |\n|                   [GPTBigCode](model_doc/gpt_bigcode)                    |       \u2705        |         \u274c         |      \u274c      |\n|               [GPTSAN-japanese](model_doc/gptsan-japanese)               |       \u2705        |         \u274c         |      \u274c      |\n|                    [Graphormer](model_doc/graphormer)                    |       \u2705        |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 5930b80b-750e-441d-a0b0-016a85c0c998
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"5930b80b-750e-441d-a0b0-016a85c0c998\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"675ebdfb-ea3d-4298-a176-65063e0c6128\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"b1026c11a801ffceb4c62d8b927841aa691f29058b283020dee0aa412c8e701e\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"70127e61-3391-411a-b291-ac102a7c8ea9\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e17aa38f94dcc590d7ae267a025f502f2f0c505b50bf4bffcc007eb5dfbf5945\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 15925, \"end_char_idx\": 16923, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u2705         |      \u2705      |\n|                       [GPT-Sw3](model_doc/gpt-sw3)                       |       \u2705        |         \u2705         |      \u2705      |\n|                   [GPTBigCode](model_doc/gpt_bigcode)                    |       \u2705        |         \u274c         |      \u274c      |\n|               [GPTSAN-japanese](model_doc/gptsan-japanese)               |       \u2705        |         \u274c         |      \u274c      |\n|                    [Graphormer](model_doc/graphormer)                    |       \u2705        |         \u274c         |      \u274c      |\n|                [Grounding DINO](model_doc/grounding-dino)                |       \u2705        |         \u274c         |      \u274c      |\n|                      [GroupViT](model_doc/groupvit)                      |       \u2705        |         \u2705         |      \u274c      |\n|                       [HerBERT](model_doc/herbert)                       |       \u2705        |         \u2705         |      \u2705      |\n|                         [Hiera](model_doc/hiera)                         |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 70127e61-3391-411a-b291-ac102a7c8ea9
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"70127e61-3391-411a-b291-ac102a7c8ea9\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"5930b80b-750e-441d-a0b0-016a85c0c998\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"2f262907e803416f3e202c9059e479e7a9d84783277bb50671adce421dd8152f\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"030b90f8-15da-49e5-894a-34a2c422e5da\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"4b3bb7991887925d62a521fe0c931874d4b63a0c5e8a89d7d6e9dc3f4949946c\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 16427, \"end_char_idx\": 17360, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                [Grounding DINO](model_doc/grounding-dino)                |       \u2705        |         \u274c         |      \u274c      |\n|                      [GroupViT](model_doc/groupvit)                      |       \u2705        |         \u2705         |      \u274c      |\n|                       [HerBERT](model_doc/herbert)                       |       \u2705        |         \u2705         |      \u2705      |\n|                         [Hiera](model_doc/hiera)                         |       \u2705        |         \u274c         |      \u274c      |\n|                        [Hubert](model_doc/hubert)                        |       \u2705        |         \u2705         |      \u274c      |\n|                        [I-BERT](model_doc/ibert)                         |       \u2705        |         \u274c         |      \u274c      |\n|                       [IDEFICS](model_doc/idefics)                       |       \u2705        |         \u2705         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 030b90f8-15da-49e5-894a-34a2c422e5da
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"030b90f8-15da-49e5-894a-34a2c422e5da\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"70127e61-3391-411a-b291-ac102a7c8ea9\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"d4c2ad91c20088b8e0041b48841635300a45765f8ddc7a45751d083613f390a8\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"8fada690-73db-40b7-ae97-f70f4e35ffb6\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"168e1fbc1c198d78f3af1d5dde355130c099ec9c02af4d0a42299bbde74a21d5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 16922, \"end_char_idx\": 17872, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                        [Hubert](model_doc/hubert)                        |       \u2705        |         \u2705         |      \u274c      |\n|                        [I-BERT](model_doc/ibert)                         |       \u2705        |         \u274c         |      \u274c      |\n|                       [IDEFICS](model_doc/idefics)                       |       \u2705        |         \u2705         |      \u274c      |\n|                      [Idefics2](model_doc/idefics2)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [ImageGPT](model_doc/imagegpt)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [Informer](model_doc/informer)                      |       \u2705        |         \u274c         |      \u274c      |\n|                  [InstructBLIP](model_doc/instructblip)                  |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 8fada690-73db-40b7-ae97-f70f4e35ffb6
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"8fada690-73db-40b7-ae97-f70f4e35ffb6\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"030b90f8-15da-49e5-894a-34a2c422e5da\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"c66845cc1a1c13586768e0adf39a00a6d24e2eaa82b1293393db0f035e3b8732\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"0c7c7cd6-9903-49db-b7d2-a035e103213d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"cee0910cdba09d4dca09ad00c67ffe8978056a3cbedd870fc81d9ec48b06f511\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 17382, \"end_char_idx\": 18358, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[Idefics2](model_doc/idefics2)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [ImageGPT](model_doc/imagegpt)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [Informer](model_doc/informer)                      |       \u2705        |         \u274c         |      \u274c      |\n|                  [InstructBLIP](model_doc/instructblip)                  |       \u2705        |         \u274c         |      \u274c      |\n|             [InstructBlipVideo](model_doc/instructblipvideo)             |       \u2705        |         \u274c         |      \u274c      |\n|                         [Jamba](model_doc/jamba)                         |       \u2705        |         \u274c         |      \u274c      |\n|                        [JetMoe](model_doc/jetmoe)                        |       \u2705        |         \u274c         |      \u274c      |\n|                       [Jukebox](model_doc/jukebox)                       |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 0c7c7cd6-9903-49db-b7d2-a035e103213d
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"0c7c7cd6-9903-49db-b7d2-a035e103213d\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"8fada690-73db-40b7-ae97-f70f4e35ffb6\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"fd1cdc4c7aef5aeff4a27be14098782a5f77df8db91483a09165c9274fed9c01\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a8ad3174-1fcf-4964-9a25-a7989b36d1f3\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"c56503a4c960489b8baa2c8efde72a975fb3c747058ee81e7a367929a9ccf331\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 17862, \"end_char_idx\": 18843, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "\u274c      |\n|             [InstructBlipVideo](model_doc/instructblipvideo)             |       \u2705        |         \u274c         |      \u274c      |\n|                         [Jamba](model_doc/jamba)                         |       \u2705        |         \u274c         |      \u274c      |\n|                        [JetMoe](model_doc/jetmoe)                        |       \u2705        |         \u274c         |      \u274c      |\n|                       [Jukebox](model_doc/jukebox)                       |       \u2705        |         \u274c         |      \u274c      |\n|                      [KOSMOS-2](model_doc/kosmos-2)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [LayoutLM](model_doc/layoutlm)                      |       \u2705        |         \u2705         |      \u274c      |\n|                    [LayoutLMv2](model_doc/layoutlmv2)                    |       \u2705        |         \u274c         |      \u274c      |\n|                    [LayoutLMv3](model_doc/layoutlmv3)                    |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: a8ad3174-1fcf-4964-9a25-a7989b36d1f3
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"a8ad3174-1fcf-4964-9a25-a7989b36d1f3\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"0c7c7cd6-9903-49db-b7d2-a035e103213d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9cb615a86d1b1453e83dbc0373d5471294cccd45c14dd924380896ed5ada9044\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"b557fca7-6b28-4e1f-8296-adda35e77b80\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"077477572b7d118fd2dbb0e06b1ef0dd1f4676e1af0ad9f2ceb0c3a00fadabb0\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 18347, \"end_char_idx\": 19280, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                      [KOSMOS-2](model_doc/kosmos-2)                      |       \u2705        |         \u274c         |      \u274c      |\n|                      [LayoutLM](model_doc/layoutlm)                      |       \u2705        |         \u2705         |      \u274c      |\n|                    [LayoutLMv2](model_doc/layoutlmv2)                    |       \u2705        |         \u274c         |      \u274c      |\n|                    [LayoutLMv3](model_doc/layoutlmv3)                    |       \u2705        |         \u2705         |      \u274c      |\n|                     [LayoutXLM](model_doc/layoutxlm)                     |       \u2705        |         \u274c         |      \u274c      |\n|                           [LED](model_doc/led)                           |       \u2705        |         \u2705         |      \u274c      |\n|                         [LeViT](model_doc/levit)                         |       \u2705        |         \u274c         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: b557fca7-6b28-4e1f-8296-adda35e77b80
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"b557fca7-6b28-4e1f-8296-adda35e77b80\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"a8ad3174-1fcf-4964-9a25-a7989b36d1f3\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"32ee90448fe6c075196db4cbbfd4bcc73876ee2c21039e00cddd020b8079f197\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"02f79f93-d2fe-42b0-b405-fb71e5a6546c\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"79a7bc66d7a967e1989eaf55e4416e338ac89fba50c43b4b2b05ae7c3bd919fb\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 18842, \"end_char_idx\": 19756, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u2705         |      \u274c      |\n|                     [LayoutXLM](model_doc/layoutxlm)                     |       \u2705        |         \u274c         |      \u274c      |\n|                           [LED](model_doc/led)                           |       \u2705        |         \u2705         |      \u274c      |\n|                         [LeViT](model_doc/levit)                         |       \u2705        |         \u274c         |      \u274c      |\n|                          [LiLT](model_doc/lilt)                          |       \u2705        |         \u274c         |      \u274c      |\n|                         [LLaMA](model_doc/llama)                         |       \u2705        |         \u274c         |      \u2705      |\n|                        [Llama2](model_doc/llama2)                        |       \u2705        |         \u274c         |      \u2705      |\n|                        [Llama3](model_doc/llama3)                        |       \u2705        |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 02f79f93-d2fe-42b0-b405-fb71e5a6546c
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"02f79f93-d2fe-42b0-b405-fb71e5a6546c\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"b557fca7-6b28-4e1f-8296-adda35e77b80\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"9a5d3973298b0c833c133539273900544ab5e795f415dcdeaf0bc463f04218ab\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"832b5863-6a7d-4fe5-889d-679f91578cf0\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"737388c2865d3a4672c8d115536a30fa25554314553c4c3aed6eae1b3fda0a39\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 19306, \"end_char_idx\": 20251, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[LiLT](model_doc/lilt)                          |       \u2705        |         \u274c         |      \u274c      |\n|                         [LLaMA](model_doc/llama)                         |       \u2705        |         \u274c         |      \u2705      |\n|                        [Llama2](model_doc/llama2)                        |       \u2705        |         \u274c         |      \u2705      |\n|                        [Llama3](model_doc/llama3)                        |       \u2705        |         \u274c         |      \u2705      |\n|                         [LLaVa](model_doc/llava)                         |       \u2705        |         \u274c         |      \u274c      |\n|                    [LLaVA-NeXT](model_doc/llava_next)                    |       \u2705        |         \u274c         |      \u274c      |\n|              [LLaVa-NeXT-Video](model_doc/llava_next_video)              |       \u2705        |         \u274c         |      \u274c      |\n|                    [Longformer](model_doc/longformer)                    |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 832b5863-6a7d-4fe5-889d-679f91578cf0
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"832b5863-6a7d-4fe5-889d-679f91578cf0\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"02f79f93-d2fe-42b0-b405-fb71e5a6546c\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"566ba572ad21fdc43517b1c6a19c5711de05106242df3692993cba95dd93517a\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"aaa980f0-e175-45ec-b693-d3abfd96e34f\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"091e509c6aca40855c004a0826c1f60e14551b0bf28a6384773349f6cbe39e9b\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 19755, \"end_char_idx\": 20688, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u2705      |\n|                         [LLaVa](model_doc/llava)                         |       \u2705        |         \u274c         |      \u274c      |\n|                    [LLaVA-NeXT](model_doc/llava_next)                    |       \u2705        |         \u274c         |      \u274c      |\n|              [LLaVa-NeXT-Video](model_doc/llava_next_video)              |       \u2705        |         \u274c         |      \u274c      |\n|                    [Longformer](model_doc/longformer)                    |       \u2705        |         \u2705         |      \u274c      |\n|                        [LongT5](model_doc/longt5)                        |       \u2705        |         \u274c         |      \u2705      |\n|                          [LUKE](model_doc/luke)                          |       \u2705        |         \u274c         |      \u274c      |\n|                        [LXMERT](model_doc/lxmert)                        |       \u2705        |         \u2705         |      \u274c      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: aaa980f0-e175-45ec-b693-d3abfd96e34f
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"aaa980f0-e175-45ec-b693-d3abfd96e34f\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"832b5863-6a7d-4fe5-889d-679f91578cf0\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"27d412a9e79be4a05c5466b3bcb3b7cdbabf57fdad8382df0bbb97b7611b56cf\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"ed9fbda6-f888-47a5-a408-933187b55c9d\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"384bd0c0909cd622a450384c95fb46eb1787cca08e5caa2df65b300e0139d686\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 20250, \"end_char_idx\": 21174, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u2705         |      \u274c      |\n|                        [LongT5](model_doc/longt5)                        |       \u2705        |         \u274c         |      \u2705      |\n|                          [LUKE](model_doc/luke)                          |       \u2705        |         \u274c         |      \u274c      |\n|                        [LXMERT](model_doc/lxmert)                        |       \u2705        |         \u2705         |      \u274c      |\n|                        [M-CTC-T](model_doc/mctct)                        |       \u2705        |         \u274c         |      \u274c      |\n|                       [M2M100](model_doc/m2m_100)                        |       \u2705        |         \u274c         |      \u274c      |\n|                    [MADLAD-400](model_doc/madlad-400)                    |       \u2705        |         \u2705         |      \u2705      |\n|                         [Mamba](model_doc/mamba)                         |       \u2705        |         \u274c"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: ed9fbda6-f888-47a5-a408-933187b55c9d
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"ed9fbda6-f888-47a5-a408-933187b55c9d\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"aaa980f0-e175-45ec-b693-d3abfd96e34f\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"0bc0e16efec0fb95437d360a8ddb211ae2f984070afbf2dda326fa5c29da7d87\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"4bb3c88a-960f-4880-a4ab-975c127be548\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"27f5c52ec20a243135233a5bdb78a7375386ec10db408ab3fc4d29009936c072\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 20712, \"end_char_idx\": 21659, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[M-CTC-T](model_doc/mctct)                        |       \u2705        |         \u274c         |      \u274c      |\n|                       [M2M100](model_doc/m2m_100)                        |       \u2705        |         \u274c         |      \u274c      |\n|                    [MADLAD-400](model_doc/madlad-400)                    |       \u2705        |         \u2705         |      \u2705      |\n|                         [Mamba](model_doc/mamba)                         |       \u2705        |         \u274c         |      \u274c      |\n|                        [mamba2](model_doc/mamba2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                        [Marian](model_doc/marian)                        |       \u2705        |         \u2705         |      \u2705      |\n|                      [MarkupLM](model_doc/markuplm)                      |       \u2705        |         \u274c         |      \u274c      |\n|                   [Mask2Former](model_doc/mask2former)                   |"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 4bb3c88a-960f-4880-a4ab-975c127be548
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"4bb3c88a-960f-4880-a4ab-975c127be548\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"ed9fbda6-f888-47a5-a408-933187b55c9d\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"5eb7e29245b597384ded6cf54cedecd932be35fa561e356bd5c9c9a2b22b778f\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"378b4505-1d37-4bd2-99ec-ed58ccd4374b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"e9945f63403b1288c5321c233d5863c37f85c7e9845ffb3ce45c720bbda00eca\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 21163, \"end_char_idx\": 22096, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|         \u274c         |      \u274c      |\n|                        [mamba2](model_doc/mamba2)                        |       \u2705        |         \u274c         |      \u274c      |\n|                        [Marian](model_doc/marian)                        |       \u2705        |         \u2705         |      \u2705      |\n|                      [MarkupLM](model_doc/markuplm)                      |       \u2705        |         \u274c         |      \u274c      |\n|                   [Mask2Former](model_doc/mask2former)                   |       \u2705        |         \u274c         |      \u274c      |\n|                    [MaskFormer](model_doc/maskformer)                    |       \u2705        |         \u274c         |      \u274c      |\n|                        [MatCha](model_doc/matcha)                        |       \u2705        |         \u274c         |      \u274c      |\n|                         [mBART](model_doc/mbart)                         |       \u2705        |         \u2705         |      \u2705      |\n|"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 378b4505-1d37-4bd2-99ec-ed58ccd4374b
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"378b4505-1d37-4bd2-99ec-ed58ccd4374b\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"4bb3c88a-960f-4880-a4ab-975c127be548\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"2f0ed1c045133e58c04c8d98ce7594ee813f6c9562f53d787cbe331c2e21f345\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"03992253-6766-42d4-a3e2-e3bd9c239309\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"843af70398ed4aec2be4f4c5792a6562eadf3d6d310f980033fd89cf800743a5\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 21658, \"end_char_idx\": 22599, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|       \u2705        |         \u274c         |      \u274c      |\n|                    [MaskFormer](model_doc/maskformer)                    |       \u2705        |         \u274c         |      \u274c      |\n|                        [MatCha](model_doc/matcha)                        |       \u2705        |         \u274c         |      \u274c      |\n|                         [mBART](model_doc/mbart)                         |       \u2705        |         \u2705         |      \u2705      |\n|                      [mBART-50](model_doc/mbart50)                       |       \u2705        |         \u2705         |      \u2705      |\n|                          [MEGA](model_doc/mega)                          |       \u2705        |         \u274c         |      \u274c      |\n|                 [Megatron-BERT](model_doc/megatron-bert)                 |       \u2705        |         \u274c         |      \u274c      |\n|                 [Megatron-GPT2](model_doc/megatron_gpt2)                 |       \u2705        |         \u2705         |      \u2705"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 03992253-6766-42d4-a3e2-e3bd9c239309
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"03992253-6766-42d4-a3e2-e3bd9c239309\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"378b4505-1d37-4bd2-99ec-ed58ccd4374b\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"eda9d073e889a372c3dea806730c3985d535343ec20ffaab43d505339ec17e9c\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"8a6f266d-0a05-4ef0-8da1-0584f4cc6879\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"3c059c2a06d3a7305565033ea80137a2dc8611a2e914bdbfe95343edc6cddbe8\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 22118, \"end_char_idx\": 23075, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "[mBART-50](model_doc/mbart50)                       |       \u2705        |         \u2705         |      \u2705      |\n|                          [MEGA](model_doc/mega)                          |       \u2705        |         \u274c         |      \u274c      |\n|                 [Megatron-BERT](model_doc/megatron-bert)                 |       \u2705        |         \u274c         |      \u274c      |\n|                 [Megatron-GPT2](model_doc/megatron_gpt2)                 |       \u2705        |         \u2705         |      \u2705      |\n|                       [MGP-STR](model_doc/mgp-str)                       |       \u2705        |         \u274c         |      \u274c      |\n|                       [Mistral](model_doc/mistral)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [Mixtral](model_doc/mixtral)                       |       \u2705        |         \u274c         |      \u274c      |\n|                         [mLUKE](model_doc/mluke)                         |       \u2705"}


created_at: 2024-08-26 20:30:03
topic: persistent://default/default/621deaf2-9359-4ac4-ada0-047176703e13
id: 8a6f266d-0a05-4ef0-8da1-0584f4cc6879
encoding: FLOAT32
metadata:
{"url": "https://huggingface.co/docs/transformers/index", "title": "\ud83e\udd17 Transformers", "tokens": 9875, "retrieve_doc": false, "source": "transformers", "_node_content": "{\"id_\": \"8a6f266d-0a05-4ef0-8da1-0584f4cc6879\", \"embedding\": null, \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"excluded_embed_metadata_keys\": [\"url\", \"tokens\", \"retrieve_doc\", \"source\"], \"excluded_llm_metadata_keys\": [\"title\", \"tokens\", \"retrieve_doc\", \"source\"], \"relationships\": {\"1\": {\"node_id\": \"ae56fe8d-ab49-4ab6-bff5-8b020af1916f\", \"node_type\": \"4\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"836865c358dea9b81d80ebb705572b7f9f4dcfd6479dc208d646d8499b9bd468\", \"class_name\": \"RelatedNodeInfo\"}, \"2\": {\"node_id\": \"03992253-6766-42d4-a3e2-e3bd9c239309\", \"node_type\": \"1\", \"metadata\": {\"url\": \"https://huggingface.co/docs/transformers/index\", \"title\": \"\\ud83e\\udd17 Transformers\", \"tokens\": 9875, \"retrieve_doc\": false, \"source\": \"transformers\"}, \"hash\": \"57bab3a5ee49ea97e37c780e1c181e2a0697504a357771adb5581a9b9b5100d3\", \"class_name\": \"RelatedNodeInfo\"}, \"3\": {\"node_id\": \"a8637029-957b-4961-a88b-b1995717f30b\", \"node_type\": \"1\", \"metadata\": {}, \"hash\": \"3aec3b261687b1f5380350cc1e9275172c9fe28e8b43087aac6c358554312977\", \"class_name\": \"RelatedNodeInfo\"}}, \"text\": \"\", \"mimetype\": \"text/plain\", \"start_char_idx\": 22591, \"end_char_idx\": 23559, \"text_template\": \"{metadata_str}\\n\\n{content}\", \"metadata_template\": \"{key}: {value}\", \"metadata_seperator\": \"\\n\", \"class_name\": \"TextNode\"}", "_node_type": "TextNode", "document_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "ref_doc_id": "ae56fe8d-ab49-4ab6-bff5-8b020af1916f", "chroma:document": "|      \u2705      |\n|                       [MGP-STR](model_doc/mgp-str)                       |       \u2705        |         \u274c         |      \u274c      |\n|                       [Mistral](model_doc/mistral)                       |       \u2705        |         \u2705         |      \u2705      |\n|                       [Mixtral](model_doc/mixtral)                       |       \u2705        |         \u274c         |      \u274c      |\n|                         [mLUKE](model_doc/mluke)                         |       \u2705        |         \u274c         |      \u274c      |\n|                           [MMS](model_doc/mms)                           |       \u2705        |         \u2705         |      \u2705      |\n|                    [MobileBERT](model_doc/mobilebert)                    |       \u2705        |         \u2705         |      \u274c      |\n|                  [MobileNetV1](model_doc/mobilenet_v1)                   |       \u2705        |         \u274c         |      \u274c      |\n|                  [MobileNetV2](model_doc/mobilenet_v2)"}


