db.py 331 Bytes
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
from peewee import *
2
from config import DATA_DIR
3
import os
Timothy J. Baek's avatar
Timothy J. Baek committed
4

5

6
7
8
9
10
11
12
13
14
15
# Check if the file exists
if os.path.exists(f"{DATA_DIR}/ollama.db"):
    # Rename the file
    os.rename(f"{DATA_DIR}/ollama.db", f"{DATA_DIR}/webui.db")
    print("File renamed successfully.")
else:
    pass


DB = SqliteDatabase(f"{DATA_DIR}/webui.db")
Timothy J. Baek's avatar
Timothy J. Baek committed
16
DB.connect()