Update tidb_impl.py
Browse files- lightrag/kg/tidb_impl.py +6 -1
lightrag/kg/tidb_impl.py
CHANGED
|
@@ -4,13 +4,18 @@ from dataclasses import dataclass
|
|
| 4 |
from typing import Union
|
| 5 |
|
| 6 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from sqlalchemy import create_engine, text
|
| 8 |
from tqdm import tqdm
|
| 9 |
|
| 10 |
from lightrag.base import BaseVectorStorage, BaseKVStorage, BaseGraphStorage
|
| 11 |
from lightrag.utils import logger
|
| 12 |
|
| 13 |
-
|
| 14 |
class TiDB(object):
|
| 15 |
def __init__(self, config, **kwargs):
|
| 16 |
self.host = config.get("host", None)
|
|
|
|
| 4 |
from typing import Union
|
| 5 |
|
| 6 |
import numpy as np
|
| 7 |
+
import pipmaster as pm
|
| 8 |
+
if not pm.is_installed("pymysql"):
|
| 9 |
+
pm.install("pymysql")
|
| 10 |
+
if not pm.is_installed("sqlalchemy"):
|
| 11 |
+
pm.install("sqlalchemy")
|
| 12 |
+
|
| 13 |
from sqlalchemy import create_engine, text
|
| 14 |
from tqdm import tqdm
|
| 15 |
|
| 16 |
from lightrag.base import BaseVectorStorage, BaseKVStorage, BaseGraphStorage
|
| 17 |
from lightrag.utils import logger
|
| 18 |
|
|
|
|
| 19 |
class TiDB(object):
|
| 20 |
def __init__(self, config, **kwargs):
|
| 21 |
self.host = config.get("host", None)
|