Spaces:
Sleeping
Sleeping
fix code 7
Browse files- preprocess.py +2 -3
preprocess.py
CHANGED
@@ -12,15 +12,14 @@ from constants import (
|
|
12 |
from database import create_redis
|
13 |
from utils import create_flat_index, load_vectors
|
14 |
|
15 |
-
pool = create_redis()
|
16 |
-
redis_conn = redis.Redis(connection_pool=pool)
|
17 |
-
|
18 |
|
19 |
def auto_truncate(text: str):
|
20 |
return text[0:MAX_TEXT_LENGTH]
|
21 |
|
22 |
|
23 |
def data_preprocessing_and_loading():
|
|
|
|
|
24 |
data = pd.read_csv(
|
25 |
DATA_PATH,
|
26 |
converters={"bullet_point": auto_truncate, "item_keywords": auto_truncate, "item_name": auto_truncate},
|
|
|
12 |
from database import create_redis
|
13 |
from utils import create_flat_index, load_vectors
|
14 |
|
|
|
|
|
|
|
15 |
|
16 |
def auto_truncate(text: str):
|
17 |
return text[0:MAX_TEXT_LENGTH]
|
18 |
|
19 |
|
20 |
def data_preprocessing_and_loading():
|
21 |
+
pool = create_redis()
|
22 |
+
redis_conn = redis.Redis(connection_pool=pool)
|
23 |
data = pd.read_csv(
|
24 |
DATA_PATH,
|
25 |
converters={"bullet_point": auto_truncate, "item_keywords": auto_truncate, "item_name": auto_truncate},
|