Skip to content

Commit

Permalink
update examples/RAG-with-Fine-Tuned-Models notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
TheVinhLuong102 committed Mar 12, 2024
1 parent c1e361b commit d0a7a1a
Showing 1 changed file with 47 additions and 9 deletions.
56 changes: 47 additions & 9 deletions examples/RAG-with-Fine-Tuned-Models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -63,14 +63,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"c:\\Users\\Aitom\\OneDrive\\CODE\\Windows\\OpenSSA\\.venv\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n",
"Parsing nodes: 100%|██████████| 121/121 [00:00<00:00, 608.15it/s]\n",
"Generating embeddings: 100%|██████████| 140/140 [00:01<00:00, 85.03it/s]\n"
]
}
],
"source": [
"documents = SimpleDirectoryReader(input_dir=RESOURCE_PATH,\n",
" input_files=None,\n",
" exclude=None,\n",
" exclude_hidden=True,\n",
" exclude=['.DS_Store', '*.json'],\n",
" exclude_hidden=False,\n",
" errors='strict',\n",
" recursive=True,\n",
" encoding='utf-8',\n",
Expand All @@ -79,9 +90,36 @@
" file_extractor=None,\n",
" num_files_limit=None,\n",
" file_metadata=None,\n",
" fs=None)\n",
" fs=None).load_data(show_progress=True,\n",
" num_workers=8)\n",
"\n",
"index = VectorStoreIndex.from_documents(documents=documents,\n",
" storage_context=None,\n",
" show_progress=True,\n",
" callback_manager=None,\n",
" transformations=None)\n",
"\n",
"index = VectorStoreIndex.from_documents(documents)"
"query_engine = index.as_query_engine()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'AMD'"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"query_engine.query('Which company do you know well?').response"
]
},
{
Expand Down

0 comments on commit d0a7a1a

Please sign in to comment.