Kevin Hu
commited on
Commit
·
9bead83
1
Parent(s):
ce9534f
deprecate init a super user (#2589)
Browse files### What problem does this PR solve?
#2295
### Type of change
- [x] Refactoring
- api/db/init_data.py +4 -2
api/db/init_data.py
CHANGED
@@ -31,10 +31,12 @@ from api.db.services.user_service import TenantService, UserTenantService
|
|
31 |
from api.settings import CHAT_MDL, EMBEDDING_MDL, ASR_MDL, IMAGE2TEXT_MDL, PARSERS, LLM_FACTORY, API_KEY, LLM_BASE_URL
|
32 |
from api.utils.file_utils import get_project_base_directory
|
33 |
|
|
|
34 |
def encode_to_base64(input_string):
|
35 |
base64_encoded = base64.b64encode(input_string.encode('utf-8'))
|
36 |
return base64_encoded.decode('utf-8')
|
37 |
|
|
|
38 |
def init_superuser():
|
39 |
user_info = {
|
40 |
"id": uuid.uuid1().hex,
|
@@ -176,8 +178,8 @@ def init_web_data():
|
|
176 |
start_time = time.time()
|
177 |
|
178 |
init_llm_factory()
|
179 |
-
if not UserService.get_all().count():
|
180 |
-
|
181 |
|
182 |
add_graph_templates()
|
183 |
print("init web data success:{}".format(time.time() - start_time))
|
|
|
31 |
from api.settings import CHAT_MDL, EMBEDDING_MDL, ASR_MDL, IMAGE2TEXT_MDL, PARSERS, LLM_FACTORY, API_KEY, LLM_BASE_URL
|
32 |
from api.utils.file_utils import get_project_base_directory
|
33 |
|
34 |
+
|
35 |
def encode_to_base64(input_string):
|
36 |
base64_encoded = base64.b64encode(input_string.encode('utf-8'))
|
37 |
return base64_encoded.decode('utf-8')
|
38 |
|
39 |
+
|
40 |
def init_superuser():
|
41 |
user_info = {
|
42 |
"id": uuid.uuid1().hex,
|
|
|
178 |
start_time = time.time()
|
179 |
|
180 |
init_llm_factory()
|
181 |
+
#if not UserService.get_all().count():
|
182 |
+
# init_superuser()
|
183 |
|
184 |
add_graph_templates()
|
185 |
print("init web data success:{}".format(time.time() - start_time))
|