Spaces:
Running
Running
Download db.py from Vanshcc/qa-rag-fastapi: direct link, hf CLI and curl.
- Browser
- Download file 250 Bytes
-
https://huggingface.co/spaces/Vanshcc/qa-rag-fastapi/resolve/main/db.py
- Command line
-
hf download hf://spaces/Vanshcc/qa-rag-fastapi/db.py
-
curl -L -o db.py https://huggingface.co/spaces/Vanshcc/qa-rag-fastapi/resolve/main/db.py
250 Bytes
| import sqlite3 | |
| conn = sqlite3.connect("rag.db", check_same_thread=False) | |
| cursor = conn.cursor() | |
| cursor.execute(""" | |
| CREATE TABLE IF NOT EXISTS chunks ( | |
| document TEXT, | |
| chunk_id INTEGER, | |
| text TEXT, | |
| embedding TEXT | |
| ) | |
| """) | |
| conn.commit() | |