Moved notebooks
This commit is contained in:
parent
ab15aa684b
commit
4a7aaf5bd4
3 changed files with 60 additions and 17 deletions
|
|
@ -203,30 +203,73 @@
|
|||
"We load the data from a local folder"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"id": "35ede28d-3f0d-490c-ac16-5fbc82bd28f9",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Get the current directory's path\n",
|
||||
"from os import listdir, path\n",
|
||||
"current_dir = path.abspath(\".\")\n",
|
||||
"\n",
|
||||
"# Get the parent directory (one level above)\n",
|
||||
"parent_dir = path.dirname(current_dir)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"id": "7417ae9b-9322-4eba-b9ea-13721cdd1574",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "ModuleNotFoundError",
|
||||
"evalue": "No module named 'cognee'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[5], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m listdir, path\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01muuid\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m uuid5, UUID\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mcognee\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m add\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# Get the current directory's path\u001b[39;00m\n\u001b[1;32m 6\u001b[0m current_dir \u001b[38;5;241m=\u001b[39m path\u001b[38;5;241m.\u001b[39mabspath(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'cognee'"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from os import listdir, path\n",
|
||||
"from uuid import uuid5, UUID\n",
|
||||
"from cognee import add\n",
|
||||
"\n",
|
||||
"# Get the current directory's path\n",
|
||||
"current_dir = path.abspath(\".\")\n",
|
||||
"\n",
|
||||
"# Get the parent directory (one level above)\n",
|
||||
"parent_dir = path.dirname(current_dir)\n",
|
||||
"\n",
|
||||
"# Now, set the data_path to the \".data\" directory inside the parent directory\n",
|
||||
"data_path = path.join(parent_dir, \".data\")\n",
|
||||
"\n",
|
||||
"results = await add(data_path, \"izmene\")\n",
|
||||
"for result in results:\n",
|
||||
" print(result)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"id": "5b3954c1-f537-4be7-a578-1d5037c21374",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"/Users/vasa/Projects/cognee/.venv/lib/python3.10/site-packages/dlt/common/configuration/container.py:90: DeprecationWarning: currentThread() is deprecated, use current_thread() instead\n",
|
||||
" if m := re.match(r\"dlt-pool-(\\d+)-\", threading.currentThread().getName()):\n",
|
||||
"/Users/vasa/Projects/cognee/.venv/lib/python3.10/site-packages/dlt/common/configuration/container.py:90: DeprecationWarning: getName() is deprecated, get the name attribute instead\n",
|
||||
" if m := re.match(r\"dlt-pool-(\\d+)-\", threading.currentThread().getName()):\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Pipeline file_load_from_filesystem load step completed in 0.32 seconds\n",
|
||||
"1 load package(s) were loaded to destination duckdb and into dataset izmene\n",
|
||||
"The duckdb destination used duckdb:///:external: location to store data\n",
|
||||
"Load package 1711035888.138656 is LOADED and contains no failed jobs\n"
|
||||
"ename": "ModuleNotFoundError",
|
||||
"evalue": "No module named 'cognee'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[2], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m listdir, path\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01muuid\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m uuid5, UUID\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mcognee\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m add\n\u001b[1;32m 5\u001b[0m data_path \u001b[38;5;241m=\u001b[39m path\u001b[38;5;241m.\u001b[39mabspath(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.data\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 7\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m add(data_path, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mizmene\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'cognee'"
|
||||
]
|
||||
}
|
||||
],
|
||||
Loading…
Add table
Reference in a new issue