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
d3622fb7
Commit
d3622fb7
authored
Jan 15, 2024
by
jyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check thread block
parent
83105d0d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
10 deletions
+13
-10
commands.py
api/commands.py
+1
-1
agent_executor.py
api/core/agent/agent_executor.py
+1
-0
indexing_runner.py
api/core/indexing_runner.py
+1
-1
llm.py
api/core/model_runtime/model_providers/spark/llm/llm.py
+2
-2
rerank.py
api/core/rerank/rerank.py
+2
-1
dataset_multi_retriever_tool.py
api/core/tool/dataset_multi_retriever_tool.py
+4
-3
dataset_retriever_tool.py
api/core/tool/dataset_retriever_tool.py
+1
-1
hit_testing_service.py
api/services/hit_testing_service.py
+1
-1
No files found.
api/commands.py
View file @
d3622fb7
...
...
@@ -481,7 +481,7 @@ def normalization_collections():
threads
.
append
(
document_format_thread
)
document_format_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
click
.
echo
(
click
.
style
(
'Congratulations! restore {} dataset indexes.'
.
format
(
len
(
normalization_count
)),
fg
=
'green'
))
...
...
api/core/agent/agent_executor.py
View file @
d3622fb7
...
...
@@ -135,6 +135,7 @@ class AgentExecutor:
try
:
output
=
agent_executor
.
run
(
input
=
query
)
logging
.
warning
(
"agent_executor finished!"
)
except
InvokeError
as
ex
:
raise
ex
except
Exception
as
ex
:
...
...
api/core/indexing_runner.py
View file @
d3622fb7
...
...
@@ -662,7 +662,7 @@ class IndexingRunner:
threads
.
append
(
document_format_thread
)
document_format_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
return
all_qa_documents
return
all_documents
...
...
api/core/model_runtime/model_providers/spark/llm/llm.py
View file @
d3622fb7
...
...
@@ -134,7 +134,7 @@ class SparkLargeLanguageModel(LargeLanguageModel):
completion
+=
delta
thread
.
join
()
thread
.
join
(
timeout
=
30
)
# transform assistant message to prompt message
assistant_prompt_message
=
AssistantPromptMessage
(
content
=
completion
...
...
@@ -194,7 +194,7 @@ class SparkLargeLanguageModel(LargeLanguageModel):
)
)
thread
.
join
()
thread
.
join
(
timeout
=
30
)
def
_to_credential_kwargs
(
self
,
credentials
:
dict
)
->
dict
:
"""
...
...
api/core/rerank/rerank.py
View file @
d3622fb7
import
logging
from
typing
import
List
,
Optional
from
core.model_manager
import
ModelInstance
...
...
@@ -39,7 +40,7 @@ class RerankRunner:
)
rerank_documents
=
[]
logging
.
warning
(
"Rerank finished!"
)
for
result
in
rerank_result
.
docs
:
# format document
rerank_document
=
Document
(
...
...
api/core/tool/dataset_multi_retriever_tool.py
View file @
d3622fb7
import
json
import
logging
import
threading
from
typing
import
List
,
Optional
,
Type
...
...
@@ -70,7 +71,7 @@ class DatasetMultiRetrieverTool(BaseTool):
threads
.
append
(
retrieval_thread
)
retrieval_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
# do rerank for searched documents
model_manager
=
ModelManager
()
rerank_model_instance
=
model_manager
.
get_model_instance
(
...
...
@@ -243,6 +244,6 @@ class DatasetMultiRetrieverTool(BaseTool):
full_text_index_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
all_documents
.
extend
(
documents
)
logging
.
warning
(
"DatasetMultiRetrieverTool finished!"
)
api/core/tool/dataset_retriever_tool.py
View file @
d3622fb7
...
...
@@ -140,7 +140,7 @@ class DatasetRetrieverTool(BaseTool):
full_text_index_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
# hybrid search: rerank after all documents have been searched
if
retrieval_model
[
'search_method'
]
==
'hybrid_search'
:
...
...
api/services/hit_testing_service.py
View file @
d3622fb7
...
...
@@ -93,7 +93,7 @@ class HitTestingService:
full_text_index_thread
.
start
()
for
thread
in
threads
:
thread
.
join
()
thread
.
join
(
timeout
=
30
)
if
retrieval_model
[
'search_method'
]
==
'hybrid_search'
:
model_manager
=
ModelManager
()
...
...
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