Skip to content

Commit 5546567

Browse files
authored
Update sql_storage.py
table name update to "modelcache_llm_answer"
1 parent 2b8d640 commit 5546567

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modelcache/manager/scalar_data/sql_storage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def update_hit_count_by_id(self, primary_id: int):
127127
conn.close()
128128

129129
def get_ids(self, deleted=True):
130-
table_name = "cache_codegpt_answer"
130+
table_name = "modelcache_llm_answer"
131131
state = 1 if deleted else 0
132132
query_sql = "Select id FROM {} WHERE is_deleted = {}".format(table_name, state)
133133

@@ -142,7 +142,7 @@ def get_ids(self, deleted=True):
142142
return ids
143143

144144
def mark_deleted(self, keys):
145-
table_name = "cache_codegpt_answer"
145+
table_name = "modelcache_llm_answer"
146146
mark_sql = " update {} set is_deleted=1 WHERE id in ({})".format(table_name, ",".join([str(i) for i in keys]))
147147

148148
# 从连接池中获取连接
@@ -159,7 +159,7 @@ def mark_deleted(self, keys):
159159
return delete_count
160160

161161
def model_deleted(self, model_name):
162-
table_name = "cache_codegpt_answer"
162+
table_name = "modelcache_llm_answer"
163163
delete_sql = "Delete from {} WHERE model='{}'".format(table_name, model_name)
164164

165165
table_log_name = "modelcache_query_log"
@@ -181,7 +181,7 @@ def model_deleted(self, model_name):
181181
return resp
182182

183183
def clear_deleted_data(self):
184-
table_name = "cache_codegpt_answer"
184+
table_name = "modelcache_llm_answer"
185185
delete_sql = "DELETE FROM {} WHERE is_deleted = 1".format(table_name)
186186

187187
conn = self.pool.connection()
@@ -196,7 +196,7 @@ def clear_deleted_data(self):
196196
return delete_count
197197

198198
def count(self, state: int = 0, is_all: bool = False):
199-
table_name = "cache_codegpt_answer"
199+
table_name = "modelcache_llm_answer"
200200
if is_all:
201201
count_sql = "SELECT COUNT(*) FROM {}".format(table_name)
202202
else:

0 commit comments

Comments
 (0)