From ec60064a8ba992bc2005d3d583dca1694f5a9fa6 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Mon, 25 Mar 2024 15:56:02 +0300 Subject: fix db path issue for lllm --- gn3/api/llm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gn3/api/llm.py') diff --git a/gn3/api/llm.py b/gn3/api/llm.py index d22a42c..cb68526 100644 --- a/gn3/api/llm.py +++ b/gn3/api/llm.py @@ -16,6 +16,7 @@ from gn3.auth import db from redis import Redis +import os import json import sqlite3 from datetime import timedelta @@ -23,6 +24,9 @@ from datetime import timedelta GnQNA = Blueprint("GnQNA", __name__) + + + def handle_errors(func): @wraps(func) def decorated_function(*args, **kwargs): @@ -73,7 +77,8 @@ def rating(task_id): results.get("query"), results.get("answer"), results.get("weight", 0)) - with db.connection(current_app.config["DATA_DIR"]) as conn: + + with db.connection(os.path.join(current_app.config["DATA_DIR"],"/llm.db")) as conn: cursor = conn.cursor() create_table = """CREATE TABLE IF NOT EXISTS Rating( user_id INTEGER NOT NULL, -- cgit v1.2.3