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
3a0a9e2d
Unverified
Commit
3a0a9e2d
authored
Aug 19, 2023
by
takatost
Committed by
GitHub
Aug 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: embedding get price definition missing (#922)
parent
0a0d6345
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
indexing_runner.py
api/core/indexing_runner.py
+1
-1
base.py
api/core/model_providers/models/embedding/base.py
+1
-1
No files found.
api/core/indexing_runner.py
View file @
3a0a9e2d
...
@@ -379,7 +379,7 @@ class IndexingRunner:
...
@@ -379,7 +379,7 @@ class IndexingRunner:
return
{
return
{
"total_segments"
:
total_segments
,
"total_segments"
:
total_segments
,
"tokens"
:
tokens
,
"tokens"
:
tokens
,
"total_price"
:
'{:f}'
.
format
(
embedding_model
.
get_token
_price
(
tokens
)),
"total_price"
:
'{:f}'
.
format
(
embedding_model
.
calc_tokens
_price
(
tokens
)),
"currency"
:
embedding_model
.
get_currency
(),
"currency"
:
embedding_model
.
get_currency
(),
"preview"
:
preview_texts
"preview"
:
preview_texts
}
}
...
...
api/core/model_providers/models/embedding/base.py
View file @
3a0a9e2d
...
@@ -50,7 +50,7 @@ class BaseEmbedding(BaseProviderModel):
...
@@ -50,7 +50,7 @@ class BaseEmbedding(BaseProviderModel):
logger
.
debug
(
f
"model: {self.name} price_config: {self._price_config}"
)
logger
.
debug
(
f
"model: {self.name} price_config: {self._price_config}"
)
return
self
.
_price_config
return
self
.
_price_config
def
calc_tokens_price
(
self
,
tokens
:
int
)
->
decimal
.
Decimal
:
def
calc_tokens_price
(
self
,
tokens
:
int
)
->
decimal
.
Decimal
:
"""
"""
calc tokens total price.
calc tokens total price.
...
...
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