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
920b2c2b
Unverified
Commit
920b2c2b
authored
Feb 27, 2024
by
Jyong
Committed by
GitHub
Feb 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/hit test tsne issue (#2581)
Co-authored-by:
jyong
<
jyong@dify.ai
>
parent
ac96d192
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
celerybeat-schedule.db
api/celerybeat-schedule.db
+0
-0
annotation_reply.py
api/core/features/annotation_reply.py
+1
-1
retrieval_service.py
api/core/rag/datasource/retrieval_service.py
+2
-2
hit_testing_service.py
api/services/hit_testing_service.py
+3
-2
No files found.
api/celerybeat-schedule.db
deleted
100644 → 0
View file @
ac96d192
File deleted
api/core/features/annotation_reply.py
View file @
920b2c2b
...
@@ -59,7 +59,7 @@ class AnnotationReplyFeature:
...
@@ -59,7 +59,7 @@ class AnnotationReplyFeature:
documents
=
vector
.
search_by_vector
(
documents
=
vector
.
search_by_vector
(
query
=
query
,
query
=
query
,
k
=
1
,
top_
k
=
1
,
score_threshold
=
score_threshold
,
score_threshold
=
score_threshold
,
filter
=
{
filter
=
{
'group_id'
:
[
dataset
.
id
]
'group_id'
:
[
dataset
.
id
]
...
...
api/core/rag/datasource/retrieval_service.py
View file @
920b2c2b
...
@@ -101,7 +101,7 @@ class RetrievalService:
...
@@ -101,7 +101,7 @@ class RetrievalService:
documents
=
keyword
.
search
(
documents
=
keyword
.
search
(
query
,
query
,
k
=
top_k
top_
k
=
top_k
)
)
all_documents
.
extend
(
documents
)
all_documents
.
extend
(
documents
)
...
@@ -121,7 +121,7 @@ class RetrievalService:
...
@@ -121,7 +121,7 @@ class RetrievalService:
documents
=
vector
.
search_by_vector
(
documents
=
vector
.
search_by_vector
(
query
,
query
,
search_type
=
'similarity_score_threshold'
,
search_type
=
'similarity_score_threshold'
,
k
=
top_k
,
top_
k
=
top_k
,
score_threshold
=
score_threshold
,
score_threshold
=
score_threshold
,
filter
=
{
filter
=
{
'group_id'
:
[
dataset
.
id
]
'group_id'
:
[
dataset
.
id
]
...
...
api/services/hit_testing_service.py
View file @
920b2c2b
...
@@ -133,8 +133,9 @@ class HitTestingService:
...
@@ -133,8 +133,9 @@ class HitTestingService:
if
embedding_length
<=
1
:
if
embedding_length
<=
1
:
return
[{
'x'
:
0
,
'y'
:
0
}]
return
[{
'x'
:
0
,
'y'
:
0
}]
concatenate_data
=
np
.
array
(
embeddings
)
.
reshape
(
embedding_length
,
-
1
)
noise
=
np
.
random
.
normal
(
0
,
1e-4
,
np
.
array
(
embeddings
)
.
shape
)
# concatenate_data = np.concatenate(embeddings)
concatenate_data
=
np
.
array
(
embeddings
)
+
noise
concatenate_data
=
concatenate_data
.
reshape
(
embedding_length
,
-
1
)
perplexity
=
embedding_length
/
2
+
1
perplexity
=
embedding_length
/
2
+
1
if
perplexity
>=
embedding_length
:
if
perplexity
>=
embedding_length
:
...
...
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