Kevin Hu
commited on
Commit
·
32204fb
1
Parent(s):
0826715
fix minimax init error (#1537)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
- api/apps/api_app.py +1 -0
- api/db/init_data.py +5 -4
api/apps/api_app.py
CHANGED
|
@@ -573,6 +573,7 @@ def completion_faq():
|
|
| 573 |
response = MINIO.get(bkt, nm)
|
| 574 |
data_type_picture["url"] = base64.b64encode(response).decode('utf-8')
|
| 575 |
data.append(data_type_picture)
|
|
|
|
| 576 |
except Exception as e:
|
| 577 |
return server_error_response(e)
|
| 578 |
|
|
|
|
| 573 |
response = MINIO.get(bkt, nm)
|
| 574 |
data_type_picture["url"] = base64.b64encode(response).decode('utf-8')
|
| 575 |
data.append(data_type_picture)
|
| 576 |
+
break
|
| 577 |
except Exception as e:
|
| 578 |
return server_error_response(e)
|
| 579 |
|
api/db/init_data.py
CHANGED
|
@@ -90,6 +90,11 @@ def init_superuser():
|
|
| 90 |
|
| 91 |
|
| 92 |
def init_llm_factory():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
factory_llm_infos = json.load(
|
| 94 |
open(
|
| 95 |
os.path.join(get_project_base_directory(), "conf", "llm_factories.json"),
|
|
@@ -108,10 +113,6 @@ def init_llm_factory():
|
|
| 108 |
LLMService.save(**llm_info)
|
| 109 |
except Exception as e:
|
| 110 |
pass
|
| 111 |
-
try:
|
| 112 |
-
LLMService.filter_delete([(LLM.fid == "MiniMax" or LLM.fid == "Minimax")])
|
| 113 |
-
except Exception as e:
|
| 114 |
-
pass
|
| 115 |
|
| 116 |
LLMFactoriesService.filter_delete([LLMFactories.name == "Local"])
|
| 117 |
LLMService.filter_delete([LLM.fid == "Local"])
|
|
|
|
| 90 |
|
| 91 |
|
| 92 |
def init_llm_factory():
|
| 93 |
+
try:
|
| 94 |
+
LLMService.filter_delete([(LLM.fid == "MiniMax" or LLM.fid == "Minimax")])
|
| 95 |
+
except Exception as e:
|
| 96 |
+
pass
|
| 97 |
+
|
| 98 |
factory_llm_infos = json.load(
|
| 99 |
open(
|
| 100 |
os.path.join(get_project_base_directory(), "conf", "llm_factories.json"),
|
|
|
|
| 113 |
LLMService.save(**llm_info)
|
| 114 |
except Exception as e:
|
| 115 |
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
LLMFactoriesService.filter_delete([LLMFactories.name == "Local"])
|
| 118 |
LLMService.filter_delete([LLM.fid == "Local"])
|