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
a938e1f1
Unverified
Commit
a938e1f1
authored
Jan 04, 2024
by
takatost
Committed by
GitHub
Jan 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: notion_indexing_estimate embedding_model_instance NPE (#1907)
parent
7c7ee633
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
indexing_runner.py
api/core/indexing_runner.py
+5
-3
No files found.
api/core/indexing_runner.py
View file @
a938e1f1
...
@@ -382,13 +382,15 @@ class IndexingRunner:
...
@@ -382,13 +382,15 @@ class IndexingRunner:
)
)
total_segments
+=
len
(
documents
)
total_segments
+=
len
(
documents
)
embedding_model_type_instance
=
None
if
embedding_model_instance
:
embedding_model_type_instance
=
embedding_model_instance
.
model_type_instance
embedding_model_type_instance
=
embedding_model_instance
.
model_type_instance
embedding_model_type_instance
=
cast
(
TextEmbeddingModel
,
embedding_model_type_instance
)
embedding_model_type_instance
=
cast
(
TextEmbeddingModel
,
embedding_model_type_instance
)
for
document
in
documents
:
for
document
in
documents
:
if
len
(
preview_texts
)
<
5
:
if
len
(
preview_texts
)
<
5
:
preview_texts
.
append
(
document
.
page_content
)
preview_texts
.
append
(
document
.
page_content
)
if
indexing_technique
==
'high_quality'
or
embedding_model
_instance
:
if
indexing_technique
==
'high_quality'
and
embedding_model_type
_instance
:
tokens
+=
embedding_model_type_instance
.
get_num_tokens
(
tokens
+=
embedding_model_type_instance
.
get_num_tokens
(
model
=
embedding_model_instance
.
model
,
model
=
embedding_model_instance
.
model
,
credentials
=
embedding_model_instance
.
credentials
,
credentials
=
embedding_model_instance
.
credentials
,
...
...
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