Created
October 15, 2024 17:18
-
-
Save alonsosilvaallende/9a304bf9514446c5a92b11445f084961 to your computer and use it in GitHub Desktop.
Fastlite-old.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nbformat": 4, | |
"nbformat_minor": 0, | |
"metadata": { | |
"colab": { | |
"provenance": [], | |
"authorship_tag": "ABX9TyN9rGMQbiKJtfM290dYmKUJ", | |
"include_colab_link": true | |
}, | |
"kernelspec": { | |
"name": "python3", | |
"display_name": "Python 3" | |
}, | |
"language_info": { | |
"name": "python" | |
} | |
}, | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"id": "view-in-github", | |
"colab_type": "text" | |
}, | |
"source": [ | |
"<a href=\"https://colab.research.google.com/gist/alonsosilvaallende/9a304bf9514446c5a92b11445f084961/fastlite-old.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"id": "DJp2vyPqsofq" | |
}, | |
"outputs": [], | |
"source": [ | |
"%pip install --quiet fastlite==0.0.4" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"%pip install --quiet sqlite-utils-sqlite-vec" | |
], | |
"metadata": { | |
"id": "PDxy4glusqWc" | |
}, | |
"execution_count": 2, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"from fastlite import *\n", | |
"from fastcore.utils import *\n", | |
"from fastcore.net import urlsave" | |
], | |
"metadata": { | |
"id": "2wxzqdhcs7rJ" | |
}, | |
"execution_count": 3, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"db = database(\":memory:\")" | |
], | |
"metadata": { | |
"id": "217JyF6Ktmgq" | |
}, | |
"execution_count": 4, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"db.execute(f\"CREATE VIRTUAL TABLE vec_items USING vec0(embedding float[384])\")" | |
], | |
"metadata": { | |
"colab": { | |
"base_uri": "https://localhost:8080/" | |
}, | |
"id": "vdcGTHUTIsM3", | |
"outputId": "0a9e3faf-1143-4f42-a950-5c6043025473" | |
}, | |
"execution_count": 5, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": [ | |
"<sqlite3.Cursor at 0x7d07bc52b240>" | |
] | |
}, | |
"metadata": {}, | |
"execution_count": 5 | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment