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
4562e83b
Unverified
Commit
4562e83b
authored
Jan 03, 2024
by
takatost
Committed by
GitHub
Jan 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: hit testing throws errors cause internal server error (#1865)
parent
7be77c19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
hit_testing.py
api/controllers/console/datasets/hit_testing.py
+5
-1
No files found.
api/controllers/console/datasets/hit_testing.py
View file @
4562e83b
import
logging
import
logging
from
flask_login
import
current_user
from
flask_login
import
current_user
from
core.model_runtime.errors.invoke
import
InvokeError
from
libs.login
import
login_required
from
libs.login
import
login_required
from
flask_restful
import
Resource
,
reqparse
,
marshal
from
flask_restful
import
Resource
,
reqparse
,
marshal
from
werkzeug.exceptions
import
InternalServerError
,
NotFound
,
Forbidden
from
werkzeug.exceptions
import
InternalServerError
,
NotFound
,
Forbidden
...
@@ -8,7 +10,7 @@ from werkzeug.exceptions import InternalServerError, NotFound, Forbidden
...
@@ -8,7 +10,7 @@ from werkzeug.exceptions import InternalServerError, NotFound, Forbidden
import
services
import
services
from
controllers.console
import
api
from
controllers.console
import
api
from
controllers.console.app.error
import
ProviderNotInitializeError
,
ProviderQuotaExceededError
,
\
from
controllers.console.app.error
import
ProviderNotInitializeError
,
ProviderQuotaExceededError
,
\
ProviderModelCurrentlyNotSupportError
ProviderModelCurrentlyNotSupportError
,
CompletionRequestError
from
controllers.console.datasets.error
import
HighQualityDatasetOnlyError
,
DatasetNotInitializedError
from
controllers.console.datasets.error
import
HighQualityDatasetOnlyError
,
DatasetNotInitializedError
from
controllers.console.setup
import
setup_required
from
controllers.console.setup
import
setup_required
from
controllers.console.wraps
import
account_initialization_required
from
controllers.console.wraps
import
account_initialization_required
...
@@ -69,6 +71,8 @@ class HitTestingApi(Resource):
...
@@ -69,6 +71,8 @@ class HitTestingApi(Resource):
raise
ProviderNotInitializeError
(
raise
ProviderNotInitializeError
(
f
"No Embedding Model or Reranking Model available. Please configure a valid provider "
f
"No Embedding Model or Reranking Model available. Please configure a valid provider "
f
"in the Settings -> Model Provider."
)
f
"in the Settings -> Model Provider."
)
except
InvokeError
as
e
:
raise
CompletionRequestError
(
e
.
description
)
except
ValueError
as
e
:
except
ValueError
as
e
:
raise
ValueError
(
str
(
e
))
raise
ValueError
(
str
(
e
))
except
Exception
as
e
:
except
Exception
as
e
:
...
...
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