Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
582ba45c
Unverified
Commit
582ba45c
authored
Feb 28, 2024
by
crazywoola
Committed by
GitHub
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 500 error when creating from the template and the provider is None (#2591)
parent
f1cbd550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
app.py
api/controllers/console/app/app.py
+3
-9
No files found.
api/controllers/console/app/app.py
View file @
582ba45c
...
@@ -124,19 +124,13 @@ class AppListApi(Resource):
...
@@ -124,19 +124,13 @@ class AppListApi(Resource):
available_models_names
=
[
f
'{model.provider.provider}.{model.model}'
for
model
in
available_models
]
available_models_names
=
[
f
'{model.provider.provider}.{model.model}'
for
model
in
available_models
]
provider_model
=
f
"{model_config_dict['model']['provider']}.{model_config_dict['model']['name']}"
provider_model
=
f
"{model_config_dict['model']['provider']}.{model_config_dict['model']['name']}"
if
provider_model
not
in
available_models_names
:
if
provider_model
not
in
available_models_names
:
model_manager
=
ModelManager
()
if
not
default_model_entity
:
model_instance
=
model_manager
.
get_default_model_instance
(
tenant_id
=
current_user
.
current_tenant_id
,
model_type
=
ModelType
.
LLM
)
if
not
model_instance
:
raise
ProviderNotInitializeError
(
raise
ProviderNotInitializeError
(
"No Default System Reasoning Model available. Please configure "
"No Default System Reasoning Model available. Please configure "
"in the Settings -> Model Provider."
)
"in the Settings -> Model Provider."
)
else
:
else
:
model_config_dict
[
"model"
][
"provider"
]
=
model_instance
.
provider
model_config_dict
[
"model"
][
"provider"
]
=
default_model_entity
.
provider
model_config_dict
[
"model"
][
"name"
]
=
model_instance
.
model
model_config_dict
[
"model"
][
"name"
]
=
default_model_entity
.
model
model_configuration
=
AppModelConfigService
.
validate_configuration
(
model_configuration
=
AppModelConfigService
.
validate_configuration
(
tenant_id
=
current_user
.
current_tenant_id
,
tenant_id
=
current_user
.
current_tenant_id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment