Spaces:
Runtime error
Runtime error
Using previous sqlite
Browse files
mvp.py
CHANGED
@@ -15,7 +15,7 @@ embedding_model = SentenceTransformer(model_name)
|
|
15 |
model_registry = get_registry().get("sentence-transformers")
|
16 |
model = model_registry.create(name="BAAI/bge-small-en-v1.5")
|
17 |
|
18 |
-
def create_interactions(db_path = "
|
19 |
conn = sqlite3.connect(db_path)
|
20 |
cursor = conn.cursor()
|
21 |
cursor.execute("""CREATE TABLE IF NOT EXISTS interactions (
|
@@ -28,7 +28,7 @@ def create_interactions(db_path = "/data/rag.db"):
|
|
28 |
)""")
|
29 |
conn.close()
|
30 |
|
31 |
-
create_interactions()
|
32 |
|
33 |
class Document(LanceModel):
|
34 |
text: str = model.SourceField()
|
@@ -72,7 +72,7 @@ def read_chunks_from_db(db_path):
|
|
72 |
reranker = ColbertReranker()
|
73 |
|
74 |
# Function to log the interaction to the SQLite database
|
75 |
-
def log_interaction(question, chunks, coherent_answer, feedback=None, additional_feedback=None, db_path='
|
76 |
conn = sqlite3.connect(db_path)
|
77 |
cursor = conn.cursor()
|
78 |
cursor.execute('''
|
|
|
15 |
model_registry = get_registry().get("sentence-transformers")
|
16 |
model = model_registry.create(name="BAAI/bge-small-en-v1.5")
|
17 |
|
18 |
+
def create_interactions(db_path = "rag.db"):
|
19 |
conn = sqlite3.connect(db_path)
|
20 |
cursor = conn.cursor()
|
21 |
cursor.execute("""CREATE TABLE IF NOT EXISTS interactions (
|
|
|
28 |
)""")
|
29 |
conn.close()
|
30 |
|
31 |
+
# create_interactions()
|
32 |
|
33 |
class Document(LanceModel):
|
34 |
text: str = model.SourceField()
|
|
|
72 |
reranker = ColbertReranker()
|
73 |
|
74 |
# Function to log the interaction to the SQLite database
|
75 |
+
def log_interaction(question, chunks, coherent_answer, feedback=None, additional_feedback=None, db_path='rag.db'):
|
76 |
conn = sqlite3.connect(db_path)
|
77 |
cursor = conn.cursor()
|
78 |
cursor.execute('''
|