rag/rag_fr_3.ipynb

4211 lines
139 KiB
Plaintext
Raw Permalink Normal View History

2024-01-03 07:46:11 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 136,
"id": "8c480c69-69bd-4d36-907b-db70f15c6959",
"metadata": {},
"outputs": [],
"source": [
"from transformers import AutoTokenizer\n",
"from sentence_transformers import SentenceTransformer\n",
"import os\n",
"import chromadb\n",
"import re\n",
"import html\n",
"import copy\n",
"from llama_cpp import Llama\n",
"import gradio as gr\n",
"from IPython.display import Markdown, display"
]
},
{
"cell_type": "markdown",
2024-01-03 15:25:30 +00:00
"id": "54a9d312-b39b-45f8-9529-57a142b6f6fc",
2024-01-17 19:50:28 +00:00
"metadata": {},
2024-01-03 07:46:11 +00:00
"source": [
2024-01-03 15:25:30 +00:00
"# Embed a folder of CERA webpages in txt format"
]
},
{
"cell_type": "markdown",
"id": "3c31df71-9eb1-499c-bbab-c92d4c870e6c",
"metadata": {},
"source": [
"## Embedding model and tokenizer"
2024-01-03 07:46:11 +00:00
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "d67fc6ef-6e90-49c0-bf3b-29d0fdaa5300",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/peportier/miniforge3/envs/RAG_ENV/lib/python3.9/site-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.\n",
" _torch_pytree._register_pytree_node(\n"
]
}
],
"source": [
"#embed_model_name = \"dangvantuan/sentence-camembert-large\"\n",
"#embed_model = HuggingFaceEmbedding(model_name=embed_model_name)\n",
"\n",
"embed_model_name = 'intfloat/multilingual-e5-large'\n",
"tokenizer = AutoTokenizer.from_pretrained(embed_model_name)\n",
"embed_model = SentenceTransformer(embed_model_name)"
]
},
{
"cell_type": "markdown",
2024-01-03 15:25:30 +00:00
"id": "71b71ca4-3e59-4cf9-a43a-2877eccfcf07",
2024-01-03 07:46:11 +00:00
"metadata": {},
"source": [
2024-01-03 15:25:30 +00:00
"## Initialize a ChromaDB persistent collection"
2024-01-03 07:46:11 +00:00
]
},
{
"cell_type": "code",
2024-01-03 15:25:30 +00:00
"execution_count": 58,
"id": "d16feaee-27b2-4c8a-9f63-bee3a9c5c724",
"metadata": {},
"outputs": [],
"source": [
"chroma_client = chromadb.PersistentClient(path=\"./chromadb\")\n",
"#chroma_client.delete_collection(name=\"cera\")\n",
"collection = chroma_client.get_or_create_collection(name=\"cera\")"
]
},
{
"cell_type": "markdown",
"id": "0adb9e64-bc3a-40c7-ab8f-c3b6bf39a15c",
"metadata": {},
"source": [
"## Embed the text of a particular web page"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "1d9f4699-8abc-45cd-a5e0-10ac6d3057f6",
"metadata": {},
"outputs": [],
"source": [
"def token_length(str):\n",
" return len(tokenizer.encode(str, add_special_tokens=False))\n",
"\n",
"def passage_str(paragraphs, title):\n",
" return f\"passage: {title}\\n\" + '\\n'.join(paragraphs)"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "0e8d1502-3afd-482d-b096-950911ea0ebc",
"metadata": {},
"outputs": [],
"source": [
"def embed_page(filename, url, title, contents, tags, chroma_collection, embed_model, max_chunk_size=512):\n",
" \n",
" documents = []\n",
" contents_to_embed = [contents]\n",
" \n",
" while contents_to_embed:\n",
" last_item = contents_to_embed.pop()\n",
" # (1) For the `multilingual-e5-large` embedding model, \n",
" # the string of a document must be prepended with \"passage:\"\n",
" # (2) Since the text of a webpage may have to be cut into many documents,\n",
" # we always add the title of the webpage at the top of a document\n",
" last_item_str = passage_str(last_item, title)\n",
" last_item_token_length = token_length(last_item_str)\n",
" \n",
" if last_item_token_length > max_chunk_size:\n",
" # If the text of the webpage, present in file `filename`, \n",
" # contains more than `max_chunk_size` tokens, it must be divided \n",
" # into multiple documents\n",
" if len(last_item) > 1:\n",
" # If there are many paragraphs in `last_item`, i.e. the current\n",
" # part of the webpage for which an embedding will be made,\n",
" # the length of `last_item` can be reduced by dividing its set of\n",
" # paragraphs in half\n",
" h = len(last_item) // 2\n",
" last_item_h1 = last_item[:h]\n",
" last_item_h2 = last_item[h:]\n",
" contents_to_embed.append(last_item_h1)\n",
" contents_to_embed.append(last_item_h2)\n",
" else:\n",
" # If `last_item` is made of only one long paragraph whose length is\n",
" # larger than `chunk_size`, this paragraph will be divided into two parts.\n",
" sentences = re.split(r'(?<=[.!?]) +', last_item[0])\n",
" \n",
" if len(sentences) > 1:\n",
" # If there are multiple sentences, try to split into two parts\n",
" i = 1\n",
" while True:\n",
" part1 = ' '.join(sentences[:i])\n",
" part2 = ' '.join(sentences[i:])\n",
" token_length_part_1 = token_length(passage_str([part1], title))\n",
" token_length_part_2 = token_length(passage_str([part2], title))\n",
" if (token_length_part_1 <= max_chunk_size and\n",
" token_length_part_2 <= max_chunk_size) or \\\n",
" token_length_part_1 > max_chunk_size:\n",
" break\n",
" i += 1\n",
" else:\n",
" # If there's only one long sentence or no suitable split found, split by words\n",
" words = last_item[0].split()\n",
" h = len(words) // 2\n",
" part1 = ' '.join(words[:h])\n",
" part2 = ' '.join(words[h:])\n",
" \n",
" contents_to_embed.append([part1])\n",
" contents_to_embed.append([part2])\n",
" else:\n",
" documents.append(last_item_str)\n",
"\n",
" # We want the documents into which a webpage has been divided \n",
" # to be in the natural reading order\n",
" documents.reverse()\n",
" embeddings = embed_model.encode(documents, normalize_embeddings=True)\n",
" embeddings = embeddings.tolist()\n",
"\n",
" # We consider the subpart of an URL as tags describing the webpage\n",
" # For example, \n",
" # \"https://www.caisse-epargne.fr/rhone-alpes/professionnels/financer-projets-optimiser-tresorerie/\"\n",
" # is associated to the tags:\n",
" # tags[0] == 'rhone-alpes'\n",
" # tags[1] == 'professionnels'\n",
" # tags[2] == 'financer-projets-optimiser-tresorerie'\n",
" if len(tags) < 2:\n",
" category = ''\n",
" else:\n",
" if tags[0] == 'rhone-alpes':\n",
" category = tags[1]\n",
" else: category = tags[0]\n",
" metadata = {'category': category, 'url': url}\n",
" # All the documents corresponding to a same webpage have the same metadata, i.e. URL and category\n",
" metadatas = [copy.deepcopy(metadata) for _ in range(len(documents))]\n",
"\n",
" ids = [filename + '-' + str(i+1) for i in range(len(documents))]\n",
"\n",
" chroma_collection.add(embeddings=embeddings, documents=documents, metadatas=metadatas, ids=ids)"
]
},
{
"cell_type": "markdown",
"id": "cb3fc271-be0b-4532-978e-8215227fa8fd",
"metadata": {},
"source": [
"## Embed all the webpages in a folder"
]
},
{
"cell_type": "code",
"execution_count": 45,
"id": "345c43c9-bc88-43c6-a0b4-5919a6893c9a",
"metadata": {},
"outputs": [],
"source": [
"def embed_folder(folder_path, chroma_collection, embed_model):\n",
" for filename in os.listdir(folder_path):\n",
" if filename.endswith('.txt'):\n",
" file_path = os.path.join(folder_path, filename)\n",
" with open(file_path, 'r') as file:\n",
" file_contents = file.read()\n",
" contents_lst = [str.replace('\\n',' ').replace('\\xa0', ' ') for str in file_contents.split('\\n\\n')]\n",
" if len(contents_lst) < 3: # contents_lst[0] is the URL, contents_lst[1] is the title, the rest is the content\n",
" continue\n",
" url = contents_lst[0]\n",
" if '?' in url: # URLs with a '?' corresponds to call to services and have no useful content\n",
" continue\n",
" title = contents_lst[1]\n",
" if not title: # when the title is absent (or empty), the page has no interest\n",
" continue\n",
" print(f\"{filename} : Start\")\n",
" prefix = 'https://www.caisse-epargne.fr/'\n",
" suffix = url.replace(prefix, '')\n",
" tags = suffix.split('/')\n",
" tags = [tag for tag in tags if tag] # remove empty parts\n",
" embed_page(filename, url, title, contents_lst[2:], tags, chroma_collection, embed_model)\n",
" print(f\"{filename} : Done\")"
]
},
{
"cell_type": "markdown",
"id": "db2c0bd4-c12f-410a-9311-512d3c61a30d",
"metadata": {},
"source": [
"## Proceed to the embedding"
]
},
{
"cell_type": "code",
"execution_count": 59,
"id": "456a51b2-fae0-4173-9103-deb5a7a8e608",
2024-01-03 07:46:11 +00:00
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [
{
2024-01-03 15:25:30 +00:00
"name": "stdout",
2024-01-03 07:46:11 +00:00
"output_type": "stream",
"text": [
"255a0eb096.txt : Start\n",
"255a0eb096.txt : Done\n",
"ce79680ee7.txt : Start\n",
"ce79680ee7.txt : Done\n",
"565b28a75b.txt : Start\n",
"565b28a75b.txt : Done\n",
"173fc21d3a.txt : Start\n",
"173fc21d3a.txt : Done\n",
"b3bd1cf160.txt : Start\n",
"b3bd1cf160.txt : Done\n",
"f73fb80f59.txt : Start\n",
"f73fb80f59.txt : Done\n",
"2b45bc13c2.txt : Start\n",
"2b45bc13c2.txt : Done\n",
"48787daff9.txt : Start\n",
"48787daff9.txt : Done\n",
"5f21a01035.txt : Start\n",
"5f21a01035.txt : Done\n",
"aa1030c5fd.txt : Start\n",
"aa1030c5fd.txt : Done\n",
"a040c90b55.txt : Start\n",
"a040c90b55.txt : Done\n",
"c3d469cbdb.txt : Start\n",
"c3d469cbdb.txt : Done\n",
"a6a1d2fea0.txt : Start\n",
"a6a1d2fea0.txt : Done\n",
"42a2928ef0.txt : Start\n",
"42a2928ef0.txt : Done\n",
"4eda4de449.txt : Start\n",
"4eda4de449.txt : Done\n",
"8cce840558.txt : Start\n",
"8cce840558.txt : Done\n",
"4a06529f5f.txt : Start\n",
"4a06529f5f.txt : Done\n",
"898d33ba09.txt : Start\n",
"898d33ba09.txt : Done\n",
"518b61af48.txt : Start\n",
"518b61af48.txt : Done\n",
"585b794776.txt : Start\n",
"585b794776.txt : Done\n",
"be98b7bc33.txt : Start\n",
"be98b7bc33.txt : Done\n",
"2e77392d24.txt : Start\n",
"2e77392d24.txt : Done\n",
"2db068af5c.txt : Start\n",
"2db068af5c.txt : Done\n",
"e6642ab0c4.txt : Start\n",
"e6642ab0c4.txt : Done\n",
"29e0f10548.txt : Start\n",
"29e0f10548.txt : Done\n",
"daa79fb76c.txt : Start\n",
"daa79fb76c.txt : Done\n",
"ba68c7b5b1.txt : Start\n",
"ba68c7b5b1.txt : Done\n",
"e9d58e832a.txt : Start\n",
"e9d58e832a.txt : Done\n",
"d950f8cfcf.txt : Start\n",
"d950f8cfcf.txt : Done\n",
"63fe8d8ecf.txt : Start\n",
"63fe8d8ecf.txt : Done\n",
"33337c3b38.txt : Start\n",
"33337c3b38.txt : Done\n",
"bd4b626414.txt : Start\n",
"bd4b626414.txt : Done\n",
"4c0e6dbaa6.txt : Start\n",
"4c0e6dbaa6.txt : Done\n",
"55262bf6bd.txt : Start\n",
"55262bf6bd.txt : Done\n",
"10edea0734.txt : Start\n",
"10edea0734.txt : Done\n",
"6035d44943.txt : Start\n",
"6035d44943.txt : Done\n",
"0480b7e99c.txt : Start\n",
"0480b7e99c.txt : Done\n",
"13e8a0bf51.txt : Start\n",
"13e8a0bf51.txt : Done\n",
"f03e1574c2.txt : Start\n",
"f03e1574c2.txt : Done\n",
"d5069cd6b3.txt : Start\n",
"d5069cd6b3.txt : Done\n",
"743fc26faf.txt : Start\n",
"743fc26faf.txt : Done\n",
"a164829b41.txt : Start\n",
"a164829b41.txt : Done\n",
"167def23bd.txt : Start\n",
"167def23bd.txt : Done\n",
"ac97457567.txt : Start\n",
"ac97457567.txt : Done\n",
"99bab73424.txt : Start\n",
"99bab73424.txt : Done\n",
"8c445da076.txt : Start\n",
"8c445da076.txt : Done\n",
"5f103512e6.txt : Start\n",
"5f103512e6.txt : Done\n",
"68b67c1aed.txt : Start\n",
"68b67c1aed.txt : Done\n",
"7a083e9237.txt : Start\n",
"7a083e9237.txt : Done\n",
"5883f2daa0.txt : Start\n",
"5883f2daa0.txt : Done\n",
"4aac6081e0.txt : Start\n",
"4aac6081e0.txt : Done\n",
"f74f2366a0.txt : Start\n",
"f74f2366a0.txt : Done\n",
"5a62906c0c.txt : Start\n",
"5a62906c0c.txt : Done\n",
"f66629c8b6.txt : Start\n",
"f66629c8b6.txt : Done\n",
"f6badfbd1a.txt : Start\n",
"f6badfbd1a.txt : Done\n",
"02c2716018.txt : Start\n",
"02c2716018.txt : Done\n",
"a3d470b7a1.txt : Start\n",
"a3d470b7a1.txt : Done\n",
"fe7a283831.txt : Start\n",
"fe7a283831.txt : Done\n",
"d850e8fd61.txt : Start\n",
"d850e8fd61.txt : Done\n",
"60465f4946.txt : Start\n",
"60465f4946.txt : Done\n",
"055634c516.txt : Start\n",
"055634c516.txt : Done\n",
"3241ba4473.txt : Start\n",
"3241ba4473.txt : Done\n",
"b236716617.txt : Start\n",
"b236716617.txt : Done\n",
"83b03c7962.txt : Start\n",
"83b03c7962.txt : Done\n",
"4bcb190e00.txt : Start\n",
"4bcb190e00.txt : Done\n",
"cd53afe27d.txt : Start\n",
"cd53afe27d.txt : Done\n",
"a4217688fc.txt : Start\n",
"a4217688fc.txt : Done\n",
"f8fbe32801.txt : Start\n",
"f8fbe32801.txt : Done\n",
"46b1703611.txt : Start\n",
"46b1703611.txt : Done\n",
"e5c158a765.txt : Start\n",
"e5c158a765.txt : Done\n",
"ee3c97b958.txt : Start\n",
"ee3c97b958.txt : Done\n",
"d482034404.txt : Start\n",
"d482034404.txt : Done\n",
"ad509b796a.txt : Start\n",
"ad509b796a.txt : Done\n",
"79e77efef1.txt : Start\n",
"79e77efef1.txt : Done\n",
"76675b7013.txt : Start\n",
"76675b7013.txt : Done\n",
"2f0acaea22.txt : Start\n",
"2f0acaea22.txt : Done\n",
"4c10109965.txt : Start\n",
"4c10109965.txt : Done\n",
"f311309f86.txt : Start\n",
"f311309f86.txt : Done\n",
"b176019d5a.txt : Start\n",
"b176019d5a.txt : Done\n",
"351e959cf7.txt : Start\n",
"351e959cf7.txt : Done\n",
"65d86a3b7f.txt : Start\n",
"65d86a3b7f.txt : Done\n",
"4bdc40e75b.txt : Start\n",
"4bdc40e75b.txt : Done\n",
"a31b7de525.txt : Start\n",
"a31b7de525.txt : Done\n",
"b7e3354b7b.txt : Start\n",
"b7e3354b7b.txt : Done\n",
"0b5be6abc0.txt : Start\n",
"0b5be6abc0.txt : Done\n",
"37a7d20803.txt : Start\n",
"37a7d20803.txt : Done\n",
"8ec5dbe18a.txt : Start\n",
"8ec5dbe18a.txt : Done\n",
"3bb79284a3.txt : Start\n",
"3bb79284a3.txt : Done\n",
"a6c4cc430f.txt : Start\n",
"a6c4cc430f.txt : Done\n",
"215d3fc7da.txt : Start\n",
"215d3fc7da.txt : Done\n",
"c776277507.txt : Start\n",
"c776277507.txt : Done\n",
"7526cecc15.txt : Start\n",
"7526cecc15.txt : Done\n",
"624a63445d.txt : Start\n",
"624a63445d.txt : Done\n",
"e9e060442f.txt : Start\n",
"e9e060442f.txt : Done\n",
"347dd2758c.txt : Start\n",
"347dd2758c.txt : Done\n",
"c37a229373.txt : Start\n",
"c37a229373.txt : Done\n",
"6f1b7077d4.txt : Start\n",
"6f1b7077d4.txt : Done\n",
"35d30e0ade.txt : Start\n",
"35d30e0ade.txt : Done\n",
"80bbbcbf2c.txt : Start\n",
"80bbbcbf2c.txt : Done\n",
"7ba26ad0e8.txt : Start\n",
"7ba26ad0e8.txt : Done\n",
"182588fbbf.txt : Start\n",
"182588fbbf.txt : Done\n",
"de94e4b189.txt : Start\n",
"de94e4b189.txt : Done\n",
"e45b0e5b68.txt : Start\n",
"e45b0e5b68.txt : Done\n",
"e2638b3436.txt : Start\n",
"e2638b3436.txt : Done\n",
"dd0a2ca5ac.txt : Start\n",
"dd0a2ca5ac.txt : Done\n",
"2e078d988f.txt : Start\n",
"2e078d988f.txt : Done\n",
"23746976e8.txt : Start\n",
"23746976e8.txt : Done\n",
"b4ab821d94.txt : Start\n",
"b4ab821d94.txt : Done\n",
"25dcc77e00.txt : Start\n",
"25dcc77e00.txt : Done\n",
"c7eb6cf9c8.txt : Start\n",
"c7eb6cf9c8.txt : Done\n",
"16e59d18b0.txt : Start\n",
"16e59d18b0.txt : Done\n",
"364b4d5147.txt : Start\n",
"364b4d5147.txt : Done\n",
"faf51f605e.txt : Start\n",
"faf51f605e.txt : Done\n",
"84d61f33dc.txt : Start\n",
"84d61f33dc.txt : Done\n",
"4c578fd78c.txt : Start\n",
"4c578fd78c.txt : Done\n",
"489cc63745.txt : Start\n",
"489cc63745.txt : Done\n",
"acdf6c334e.txt : Start\n",
"acdf6c334e.txt : Done\n",
"d720fc241d.txt : Start\n",
"d720fc241d.txt : Done\n",
"9c16ef30f1.txt : Start\n",
"9c16ef30f1.txt : Done\n",
"2426f559ec.txt : Start\n",
"2426f559ec.txt : Done\n",
"a0cabc58ba.txt : Start\n",
"a0cabc58ba.txt : Done\n",
"aabc3549f4.txt : Start\n",
"aabc3549f4.txt : Done\n",
"3bbb946fb3.txt : Start\n",
"3bbb946fb3.txt : Done\n",
"4a5736d002.txt : Start\n",
"4a5736d002.txt : Done\n",
"b986d4224b.txt : Start\n",
"b986d4224b.txt : Done\n",
"acd10eaae3.txt : Start\n",
"acd10eaae3.txt : Done\n",
"6bac4f4e5a.txt : Start\n",
"6bac4f4e5a.txt : Done\n",
"edea3bec7b.txt : Start\n",
"edea3bec7b.txt : Done\n",
"6611e528c9.txt : Start\n",
"6611e528c9.txt : Done\n",
"54ce3f1081.txt : Start\n",
"54ce3f1081.txt : Done\n",
"1843d92a2e.txt : Start\n",
"1843d92a2e.txt : Done\n",
"69f0b5362f.txt : Start\n",
"69f0b5362f.txt : Done\n",
"2ac98f70a3.txt : Start\n",
"2ac98f70a3.txt : Done\n",
"4d4eef5de1.txt : Start\n",
"4d4eef5de1.txt : Done\n",
"3598605354.txt : Start\n",
"3598605354.txt : Done\n",
"8d9da55793.txt : Start\n",
"8d9da55793.txt : Done\n",
"90efeedace.txt : Start\n",
"90efeedace.txt : Done\n",
"b222a935a2.txt : Start\n",
"b222a935a2.txt : Done\n",
"9a54cdc2d6.txt : Start\n",
"9a54cdc2d6.txt : Done\n",
"7d9e416887.txt : Start\n",
"7d9e416887.txt : Done\n",
"a2f809e07a.txt : Start\n",
"a2f809e07a.txt : Done\n",
"f82f526635.txt : Start\n",
"f82f526635.txt : Done\n",
"49fc042883.txt : Start\n",
"49fc042883.txt : Done\n",
"401b54bb3a.txt : Start\n",
"401b54bb3a.txt : Done\n",
"e88e322e77.txt : Start\n",
"e88e322e77.txt : Done\n",
"9ff584c6a9.txt : Start\n",
"9ff584c6a9.txt : Done\n",
"77dd96cdb0.txt : Start\n",
"77dd96cdb0.txt : Done\n",
"d49e768bef.txt : Start\n",
"d49e768bef.txt : Done\n",
"c145d2aa96.txt : Start\n",
"c145d2aa96.txt : Done\n",
"618b26d15d.txt : Start\n",
"618b26d15d.txt : Done\n",
"d609cf2c68.txt : Start\n",
"d609cf2c68.txt : Done\n",
"3d159cbe89.txt : Start\n",
"3d159cbe89.txt : Done\n",
"e53a699f5b.txt : Start\n",
"e53a699f5b.txt : Done\n",
"7bee3a53d3.txt : Start\n",
"7bee3a53d3.txt : Done\n",
"40e0072e9e.txt : Start\n",
"40e0072e9e.txt : Done\n",
"55da73699b.txt : Start\n",
"55da73699b.txt : Done\n",
"e60e8a6463.txt : Start\n",
"e60e8a6463.txt : Done\n",
"5e0583f23a.txt : Start\n",
"5e0583f23a.txt : Done\n",
"b2be33ebf5.txt : Start\n",
"b2be33ebf5.txt : Done\n",
"ad5d201dda.txt : Start\n",
"ad5d201dda.txt : Done\n",
"d48b16c825.txt : Start\n",
"d48b16c825.txt : Done\n",
"2a518c5c8a.txt : Start\n",
"2a518c5c8a.txt : Done\n",
"88346ffb46.txt : Start\n",
"88346ffb46.txt : Done\n",
"3f3e46760c.txt : Start\n",
"3f3e46760c.txt : Done\n",
"dbbeb6c739.txt : Start\n",
"dbbeb6c739.txt : Done\n",
"8e6a00bdc1.txt : Start\n",
"8e6a00bdc1.txt : Done\n",
"80a9d4e127.txt : Start\n",
"80a9d4e127.txt : Done\n",
"833d60cb6c.txt : Start\n",
"833d60cb6c.txt : Done\n",
"2c55313e35.txt : Start\n",
"2c55313e35.txt : Done\n",
"cd62a89eed.txt : Start\n",
"cd62a89eed.txt : Done\n",
"78686c36f9.txt : Start\n",
"78686c36f9.txt : Done\n",
"e688957c46.txt : Start\n",
"e688957c46.txt : Done\n",
"7aa9e50a1f.txt : Start\n",
"7aa9e50a1f.txt : Done\n",
"51e2ac338a.txt : Start\n",
"51e2ac338a.txt : Done\n",
"51a68d9313.txt : Start\n",
"51a68d9313.txt : Done\n",
"5fb7a523a7.txt : Start\n",
"5fb7a523a7.txt : Done\n",
"f49d62acf6.txt : Start\n",
"f49d62acf6.txt : Done\n",
"3ced86d1db.txt : Start\n",
"3ced86d1db.txt : Done\n",
"debbca28fa.txt : Start\n",
"debbca28fa.txt : Done\n",
"bfeaa8b440.txt : Start\n",
"bfeaa8b440.txt : Done\n",
"9ddab20d94.txt : Start\n",
"9ddab20d94.txt : Done\n",
"66df15f567.txt : Start\n",
"66df15f567.txt : Done\n",
"f42bf02416.txt : Start\n",
"f42bf02416.txt : Done\n",
"c8234b7b50.txt : Start\n",
"c8234b7b50.txt : Done\n",
"4c0aba7cbb.txt : Start\n",
"4c0aba7cbb.txt : Done\n",
"2e41ac0342.txt : Start\n",
"2e41ac0342.txt : Done\n",
"00e9b7dba8.txt : Start\n",
"00e9b7dba8.txt : Done\n",
"3add1ed406.txt : Start\n",
"3add1ed406.txt : Done\n",
"69f188b16a.txt : Start\n",
"69f188b16a.txt : Done\n",
"73b277c156.txt : Start\n",
"73b277c156.txt : Done\n",
"d2ad8952b8.txt : Start\n",
"d2ad8952b8.txt : Done\n",
"f77eddd823.txt : Start\n",
"f77eddd823.txt : Done\n",
"07852c3122.txt : Start\n",
"07852c3122.txt : Done\n",
"966c432839.txt : Start\n",
"966c432839.txt : Done\n",
"8ced9fefee.txt : Start\n",
"8ced9fefee.txt : Done\n",
"06c152d200.txt : Start\n",
"06c152d200.txt : Done\n",
"f11b7b8fce.txt : Start\n",
"f11b7b8fce.txt : Done\n",
"09b3f765cf.txt : Start\n",
"09b3f765cf.txt : Done\n",
"861738ff97.txt : Start\n",
"861738ff97.txt : Done\n",
"c98c007358.txt : Start\n",
"c98c007358.txt : Done\n",
"1e209c2f7c.txt : Start\n",
"1e209c2f7c.txt : Done\n",
"34dc461327.txt : Start\n",
"34dc461327.txt : Done\n",
"592a315fc4.txt : Start\n",
"592a315fc4.txt : Done\n",
"f8f9a61e79.txt : Start\n",
"f8f9a61e79.txt : Done\n",
"49f945e30f.txt : Start\n",
"49f945e30f.txt : Done\n",
"b39e06064b.txt : Start\n",
"b39e06064b.txt : Done\n",
"6b44932499.txt : Start\n",
"6b44932499.txt : Done\n",
"3bb5f27823.txt : Start\n",
"3bb5f27823.txt : Done\n",
"a54dfc4265.txt : Start\n",
"a54dfc4265.txt : Done\n",
"3bbe30b18a.txt : Start\n",
"3bbe30b18a.txt : Done\n",
"27582f5949.txt : Start\n",
"27582f5949.txt : Done\n",
"ac82a34e3e.txt : Start\n",
"ac82a34e3e.txt : Done\n",
"cbd0706bd5.txt : Start\n",
"cbd0706bd5.txt : Done\n",
"d38e72ab4a.txt : Start\n",
"d38e72ab4a.txt : Done\n",
"d6b0c46314.txt : Start\n",
"d6b0c46314.txt : Done\n",
"7549112ce8.txt : Start\n",
"7549112ce8.txt : Done\n",
"c64375ea25.txt : Start\n",
"c64375ea25.txt : Done\n",
"5242939ba7.txt : Start\n",
"5242939ba7.txt : Done\n",
"51e1e6a825.txt : Start\n",
"51e1e6a825.txt : Done\n",
"7cde74e885.txt : Start\n",
"7cde74e885.txt : Done\n",
"d8adaab329.txt : Start\n",
"d8adaab329.txt : Done\n",
"79f444033c.txt : Start\n",
"79f444033c.txt : Done\n",
"75bef15d20.txt : Start\n",
"75bef15d20.txt : Done\n",
"ab8dbcdc59.txt : Start\n",
"ab8dbcdc59.txt : Done\n",
"ed1f98efc6.txt : Start\n",
"ed1f98efc6.txt : Done\n",
"a20a7a7bb1.txt : Start\n",
"a20a7a7bb1.txt : Done\n",
"c3d7990cb5.txt : Start\n",
"c3d7990cb5.txt : Done\n",
"ba4dbfd475.txt : Start\n",
"ba4dbfd475.txt : Done\n",
"059eb08b87.txt : Start\n",
"059eb08b87.txt : Done\n",
"df20818635.txt : Start\n",
"df20818635.txt : Done\n",
"4eff143f3f.txt : Start\n",
"4eff143f3f.txt : Done\n",
"eff4b7ddd6.txt : Start\n",
"eff4b7ddd6.txt : Done\n",
"0e81a328c1.txt : Start\n",
"0e81a328c1.txt : Done\n",
"75b4d7d9a7.txt : Start\n",
"75b4d7d9a7.txt : Done\n",
"5e2ba7946b.txt : Start\n",
"5e2ba7946b.txt : Done\n",
"d0043c604c.txt : Start\n",
"d0043c604c.txt : Done\n",
"e7c857ad2b.txt : Start\n",
"e7c857ad2b.txt : Done\n",
"a8c6752cce.txt : Start\n",
"a8c6752cce.txt : Done\n",
"165517dfe7.txt : Start\n",
"165517dfe7.txt : Done\n",
"61d25d4835.txt : Start\n",
"61d25d4835.txt : Done\n",
"9e3c26ac16.txt : Start\n",
"9e3c26ac16.txt : Done\n",
"e6bb195473.txt : Start\n",
"e6bb195473.txt : Done\n",
"836c1b074b.txt : Start\n",
"836c1b074b.txt : Done\n",
"83e2969710.txt : Start\n",
"83e2969710.txt : Done\n",
"644186a433.txt : Start\n",
"644186a433.txt : Done\n",
"a75aa7df01.txt : Start\n",
"a75aa7df01.txt : Done\n",
"a0398ee914.txt : Start\n",
"a0398ee914.txt : Done\n",
"bc2a847131.txt : Start\n",
"bc2a847131.txt : Done\n",
"7868bec686.txt : Start\n",
"7868bec686.txt : Done\n",
"63f1d8dabd.txt : Start\n",
"63f1d8dabd.txt : Done\n",
"ce669e66f8.txt : Start\n",
"ce669e66f8.txt : Done\n",
"792190c4e9.txt : Start\n",
"792190c4e9.txt : Done\n",
"29c3723901.txt : Start\n",
"29c3723901.txt : Done\n",
"8ae6d05877.txt : Start\n",
"8ae6d05877.txt : Done\n",
"dd05acb3cb.txt : Start\n",
"dd05acb3cb.txt : Done\n",
"a817449f48.txt : Start\n",
"a817449f48.txt : Done\n",
"967cdecccf.txt : Start\n",
"967cdecccf.txt : Done\n",
"4ebd32b3b4.txt : Start\n",
"4ebd32b3b4.txt : Done\n",
"a60556b6b3.txt : Start\n",
"a60556b6b3.txt : Done\n",
"a719b96889.txt : Start\n",
"a719b96889.txt : Done\n",
"c079c36809.txt : Start\n",
"c079c36809.txt : Done\n",
"c0a4d8856e.txt : Start\n",
"c0a4d8856e.txt : Done\n",
"e707711e05.txt : Start\n",
"e707711e05.txt : Done\n",
"f7217535d5.txt : Start\n",
"f7217535d5.txt : Done\n",
"09bb9ce67b.txt : Start\n",
"09bb9ce67b.txt : Done\n",
"c6e4320cce.txt : Start\n",
"c6e4320cce.txt : Done\n",
"1255f41d67.txt : Start\n",
"1255f41d67.txt : Done\n",
"d84a0d7a60.txt : Start\n",
"d84a0d7a60.txt : Done\n",
"e912b95fb7.txt : Start\n",
"e912b95fb7.txt : Done\n",
"6c91560cb6.txt : Start\n",
"6c91560cb6.txt : Done\n",
"23d4b1a861.txt : Start\n",
"23d4b1a861.txt : Done\n",
"56fcef62ef.txt : Start\n",
"56fcef62ef.txt : Done\n",
"8ef40bc843.txt : Start\n",
"8ef40bc843.txt : Done\n",
"ee1f44ee32.txt : Start\n",
"ee1f44ee32.txt : Done\n",
"6667c30343.txt : Start\n",
"6667c30343.txt : Done\n",
"a6472532fd.txt : Start\n",
"a6472532fd.txt : Done\n",
"d47b684de9.txt : Start\n",
"d47b684de9.txt : Done\n",
"a6e9d84a26.txt : Start\n",
"a6e9d84a26.txt : Done\n",
"8cb1148ce2.txt : Start\n",
"8cb1148ce2.txt : Done\n",
"2041450bbc.txt : Start\n",
"2041450bbc.txt : Done\n",
"c9b741cf85.txt : Start\n",
"c9b741cf85.txt : Done\n",
"3b494f8454.txt : Start\n",
"3b494f8454.txt : Done\n",
"7b58b43097.txt : Start\n",
"7b58b43097.txt : Done\n",
"f6d921ced8.txt : Start\n",
"f6d921ced8.txt : Done\n",
"a774f5dcb0.txt : Start\n",
"a774f5dcb0.txt : Done\n",
"a607314ff3.txt : Start\n",
"a607314ff3.txt : Done\n",
"47d6b05426.txt : Start\n",
"47d6b05426.txt : Done\n",
"7f501b252e.txt : Start\n",
"7f501b252e.txt : Done\n",
"6d23b1599b.txt : Start\n",
"6d23b1599b.txt : Done\n",
"e854f24006.txt : Start\n",
"e854f24006.txt : Done\n",
"02b3aa0475.txt : Start\n",
"02b3aa0475.txt : Done\n",
"0bb6c71f04.txt : Start\n",
"0bb6c71f04.txt : Done\n",
"b23bb1811f.txt : Start\n",
"b23bb1811f.txt : Done\n",
"d7e4d2661b.txt : Start\n",
"d7e4d2661b.txt : Done\n",
"d1b7f85297.txt : Start\n",
"d1b7f85297.txt : Done\n",
"5007221a16.txt : Start\n",
"5007221a16.txt : Done\n",
"e3e5d4095f.txt : Start\n",
"e3e5d4095f.txt : Done\n",
"6a5a514a6d.txt : Start\n",
"6a5a514a6d.txt : Done\n",
"b679419d52.txt : Start\n",
"b679419d52.txt : Done\n",
"beb8106365.txt : Start\n",
"beb8106365.txt : Done\n",
"56b5faeff6.txt : Start\n",
"56b5faeff6.txt : Done\n",
"f4e750afc4.txt : Start\n",
"f4e750afc4.txt : Done\n",
"13880701f6.txt : Start\n",
"13880701f6.txt : Done\n",
"28c6c56435.txt : Start\n",
"28c6c56435.txt : Done\n",
"318852640c.txt : Start\n",
"318852640c.txt : Done\n",
"062719aca5.txt : Start\n",
"062719aca5.txt : Done\n",
"0e46adf00f.txt : Start\n",
"0e46adf00f.txt : Done\n",
"6507087bb8.txt : Start\n",
"6507087bb8.txt : Done\n",
"f72f737ba9.txt : Start\n",
"f72f737ba9.txt : Done\n",
"ad1b4fddea.txt : Start\n",
"ad1b4fddea.txt : Done\n",
"2c8100c054.txt : Start\n",
"2c8100c054.txt : Done\n",
"a21f6dd6e2.txt : Start\n",
"a21f6dd6e2.txt : Done\n",
"c98558432b.txt : Start\n",
"c98558432b.txt : Done\n",
"25594d754c.txt : Start\n",
"25594d754c.txt : Done\n",
"f378d7a627.txt : Start\n",
"f378d7a627.txt : Done\n",
"00de2ed323.txt : Start\n",
"00de2ed323.txt : Done\n",
"c548857fc6.txt : Start\n",
"c548857fc6.txt : Done\n",
"fda6960842.txt : Start\n",
"fda6960842.txt : Done\n",
"3dbfdeb28e.txt : Start\n",
"3dbfdeb28e.txt : Done\n",
"667b92c747.txt : Start\n",
"667b92c747.txt : Done\n",
"2f45fbeb96.txt : Start\n",
"2f45fbeb96.txt : Done\n",
"ea8ade1ec9.txt : Start\n",
"ea8ade1ec9.txt : Done\n",
"2500693c8c.txt : Start\n",
"2500693c8c.txt : Done\n",
"b3ec5aec10.txt : Start\n",
"b3ec5aec10.txt : Done\n",
"c7c60ec498.txt : Start\n",
"c7c60ec498.txt : Done\n",
"2639b3f232.txt : Start\n",
"2639b3f232.txt : Done\n",
"05cebd07f6.txt : Start\n",
"05cebd07f6.txt : Done\n",
"2c70d7a211.txt : Start\n",
"2c70d7a211.txt : Done\n",
"c482ae0d6a.txt : Start\n",
"c482ae0d6a.txt : Done\n",
"c8b2e1ea64.txt : Start\n",
"c8b2e1ea64.txt : Done\n",
"cc6023fd33.txt : Start\n",
"cc6023fd33.txt : Done\n",
"66dcfdc952.txt : Start\n",
"66dcfdc952.txt : Done\n",
"db3997fa66.txt : Start\n",
"db3997fa66.txt : Done\n",
"5cc73e5eb8.txt : Start\n",
"5cc73e5eb8.txt : Done\n",
"e2c63447a3.txt : Start\n",
"e2c63447a3.txt : Done\n",
"bf9981f1c7.txt : Start\n",
"bf9981f1c7.txt : Done\n",
"f9c1d63857.txt : Start\n",
"f9c1d63857.txt : Done\n",
"f5ad27d7c0.txt : Start\n",
"f5ad27d7c0.txt : Done\n",
"9c6cf67aa0.txt : Start\n",
"9c6cf67aa0.txt : Done\n",
"2a6ed256ac.txt : Start\n",
"2a6ed256ac.txt : Done\n",
"a0bc734be1.txt : Start\n",
"a0bc734be1.txt : Done\n",
"84aa61e2cd.txt : Start\n",
"84aa61e2cd.txt : Done\n",
"94a849a3dd.txt : Start\n",
"94a849a3dd.txt : Done\n",
"d17d48de9f.txt : Start\n",
"d17d48de9f.txt : Done\n",
"441b6dd9fb.txt : Start\n",
"441b6dd9fb.txt : Done\n",
"81ef81f563.txt : Start\n",
"81ef81f563.txt : Done\n",
"d5be4d3e85.txt : Start\n",
"d5be4d3e85.txt : Done\n",
"a968ac3598.txt : Start\n",
"a968ac3598.txt : Done\n",
"bd56123a22.txt : Start\n",
"bd56123a22.txt : Done\n",
"f93308201d.txt : Start\n",
"f93308201d.txt : Done\n",
"0b8e6baade.txt : Start\n",
"0b8e6baade.txt : Done\n",
"5ef2ba0d6f.txt : Start\n",
"5ef2ba0d6f.txt : Done\n",
"f07322d8df.txt : Start\n",
"f07322d8df.txt : Done\n",
"ef44110d87.txt : Start\n",
"ef44110d87.txt : Done\n",
"cf19743995.txt : Start\n",
"cf19743995.txt : Done\n",
"c073cfa358.txt : Start\n",
"c073cfa358.txt : Done\n",
"5f9c4f1f1f.txt : Start\n",
"5f9c4f1f1f.txt : Done\n",
"4de1c37ee8.txt : Start\n",
"4de1c37ee8.txt : Done\n",
"694551449e.txt : Start\n",
"694551449e.txt : Done\n",
"4adf02d48f.txt : Start\n",
"4adf02d48f.txt : Done\n",
"75ed4241e1.txt : Start\n",
"75ed4241e1.txt : Done\n",
"e73d5574d3.txt : Start\n",
"e73d5574d3.txt : Done\n",
"7e75ecd1e8.txt : Start\n",
"7e75ecd1e8.txt : Done\n",
"de31d88f0f.txt : Start\n",
"de31d88f0f.txt : Done\n",
"a7b7f0cf8b.txt : Start\n",
"a7b7f0cf8b.txt : Done\n",
"385444771f.txt : Start\n",
"385444771f.txt : Done\n",
"55022ab079.txt : Start\n",
"55022ab079.txt : Done\n",
"849689b4a1.txt : Start\n",
"849689b4a1.txt : Done\n",
"b278eed9ba.txt : Start\n",
"b278eed9ba.txt : Done\n",
"9e3e6ecdc1.txt : Start\n",
"9e3e6ecdc1.txt : Done\n",
"e37b2c1048.txt : Start\n",
"e37b2c1048.txt : Done\n",
"b366762650.txt : Start\n",
"b366762650.txt : Done\n",
"3c25273538.txt : Start\n",
"3c25273538.txt : Done\n",
"00c24abbbd.txt : Start\n",
"00c24abbbd.txt : Done\n",
"a6320d9006.txt : Start\n",
"a6320d9006.txt : Done\n",
"56a7a9450b.txt : Start\n",
"56a7a9450b.txt : Done\n",
"73f0b14dc0.txt : Start\n",
"73f0b14dc0.txt : Done\n",
"940cb1ea4b.txt : Start\n",
"940cb1ea4b.txt : Done\n",
"753aefd89c.txt : Start\n",
"753aefd89c.txt : Done\n",
"b56d0efe5f.txt : Start\n",
"b56d0efe5f.txt : Done\n",
"a6575b6354.txt : Start\n",
"a6575b6354.txt : Done\n",
"ff15e2aa90.txt : Start\n",
"ff15e2aa90.txt : Done\n",
"4aeb967bdb.txt : Start\n",
"4aeb967bdb.txt : Done\n",
"e8e3f5c3da.txt : Start\n",
"e8e3f5c3da.txt : Done\n",
"84fd5c6c82.txt : Start\n",
"84fd5c6c82.txt : Done\n",
"ba21aab5a7.txt : Start\n",
"ba21aab5a7.txt : Done\n",
"0eb135a63b.txt : Start\n",
"0eb135a63b.txt : Done\n",
"01f4ec6a93.txt : Start\n",
"01f4ec6a93.txt : Done\n",
"c96f15eb18.txt : Start\n",
"c96f15eb18.txt : Done\n",
"d36c2f7f4a.txt : Start\n",
"d36c2f7f4a.txt : Done\n",
"474efbd959.txt : Start\n",
"474efbd959.txt : Done\n",
"191dd3cd6e.txt : Start\n",
"191dd3cd6e.txt : Done\n",
"586213807b.txt : Start\n",
"586213807b.txt : Done\n",
"abc07266f1.txt : Start\n",
"abc07266f1.txt : Done\n",
"4dc74ef251.txt : Start\n",
"4dc74ef251.txt : Done\n",
"4c0f76583e.txt : Start\n",
"4c0f76583e.txt : Done\n",
"dafc4b7fbb.txt : Start\n",
"dafc4b7fbb.txt : Done\n",
"6123ccc4f8.txt : Start\n",
"6123ccc4f8.txt : Done\n",
"b4ecf8ff62.txt : Start\n",
"b4ecf8ff62.txt : Done\n",
"b1a1fbb48b.txt : Start\n",
"b1a1fbb48b.txt : Done\n",
"436afdfd4e.txt : Start\n",
"436afdfd4e.txt : Done\n",
"5edd73f58b.txt : Start\n",
"5edd73f58b.txt : Done\n",
"e495483bdd.txt : Start\n",
"e495483bdd.txt : Done\n"
]
}
],
"source": [
2024-01-03 15:25:30 +00:00
"embed_folder('docs/cera2', collection, embed_model)"
]
},
{
"cell_type": "markdown",
"id": "227ce12e-f33e-485d-a3d2-0e131279776d",
"metadata": {},
"source": [
"# Query the ChromaDB collection"
]
},
{
"cell_type": "code",
"execution_count": 114,
"id": "8a81c2c1-4d94-47f2-8998-f65e01505629",
"metadata": {},
"outputs": [],
"source": [
"def query_collection(query, n_results=3):\n",
" query = 'query: ' + query\n",
" query_embedding = embed_model.encode(query, normalize_embeddings=True)\n",
" query_embedding = query_embedding.tolist()\n",
" results = collection.query(\n",
" query_embeddings=[query_embedding],\n",
" n_results=n_results,\n",
" )\n",
" return results"
]
},
{
"cell_type": "code",
"execution_count": 401,
"id": "5ccd0b6d-32d8-497e-aca6-38f84c8e1f4d",
"metadata": {},
"outputs": [],
"source": [
"query = \"Comment la Caisse d'Epargne Rhône-Alpes peut-elle aider une entreprise qui rencontre des problèmes de trésorerie ?\"\n",
"query_results = query_collection(query)"
]
},
{
"cell_type": "markdown",
"id": "631ab89d-55f7-4d89-9e82-0d1a09359c79",
2024-01-03 20:36:33 +00:00
"metadata": {},
2024-01-03 15:25:30 +00:00
"source": [
"# LLM model"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "bc970979-82f3-46c4-ab86-4d9bf65acdd6",
"metadata": {
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"llama_model_loader: loaded meta data with 21 key-value pairs and 291 tensors from /Users/peportier/llm/a/a/zephyr-7b-beta.Q5_K_M.gguf (version GGUF V3 (latest))\n",
"llama_model_loader: - tensor 0: token_embd.weight q5_K [ 4096, 32000, 1, 1 ]\n",
"llama_model_loader: - tensor 1: blk.0.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 2: blk.0.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 3: blk.0.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 4: blk.0.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 5: blk.0.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 6: blk.0.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 7: blk.0.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 8: blk.0.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 9: blk.0.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 10: blk.1.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 11: blk.1.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 12: blk.1.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 13: blk.1.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 14: blk.1.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 15: blk.1.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 16: blk.1.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 17: blk.1.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 18: blk.1.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 19: blk.2.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 20: blk.2.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 21: blk.2.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 22: blk.2.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 23: blk.2.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 24: blk.2.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 25: blk.2.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 26: blk.2.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 27: blk.2.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 28: blk.3.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 29: blk.3.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 30: blk.3.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 31: blk.3.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 32: blk.3.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 33: blk.3.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 34: blk.3.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 35: blk.3.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 36: blk.3.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 37: blk.4.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 38: blk.4.ffn_down.weight q5_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 39: blk.4.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 40: blk.4.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 41: blk.4.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 42: blk.4.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 43: blk.4.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 44: blk.4.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 45: blk.4.attn_v.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 46: blk.5.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 47: blk.5.ffn_down.weight q5_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 48: blk.5.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 49: blk.5.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 50: blk.5.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 51: blk.5.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 52: blk.5.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 53: blk.5.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 54: blk.5.attn_v.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 55: blk.6.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 56: blk.6.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 57: blk.6.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 58: blk.6.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 59: blk.6.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 60: blk.6.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 61: blk.6.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 62: blk.6.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 63: blk.6.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 64: blk.7.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 65: blk.7.ffn_down.weight q5_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 66: blk.7.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 67: blk.7.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 68: blk.7.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 69: blk.7.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 70: blk.7.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 71: blk.7.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 72: blk.7.attn_v.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 73: blk.8.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 74: blk.8.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 75: blk.8.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 76: blk.8.attn_v.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 77: blk.10.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 78: blk.10.ffn_down.weight q5_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 79: blk.10.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 80: blk.10.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 81: blk.10.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 82: blk.10.attn_k.weight q5_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 83: blk.10.attn_output.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 84: blk.10.attn_q.weight q5_K [ 4096, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 85: blk.10.attn_v.weight q6_K [ 4096, 1024, 1, 1 ]\n",
"llama_model_loader: - tensor 86: blk.11.attn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",
"llama_model_loader: - tensor 87: blk.11.ffn_down.weight q6_K [ 14336, 4096, 1, 1 ]\n",
"llama_model_loader: - tensor 88: blk.11.ffn_gate.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 89: blk.11.ffn_up.weight q5_K [ 4096, 14336, 1, 1 ]\n",
"llama_model_loader: - tensor 90: blk.11.ffn_norm.weight f32 [ 4096, 1, 1, 1 ]\n",