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
a31466d3
Unverified
Commit
a31466d3
authored
Sep 27, 2023
by
takatost
Committed by
GitHub
Sep 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: db session not commit before long llm call running (#1251)
parent
d38eac95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
base.py
api/core/model_providers/models/llm/base.py
+5
-0
No files found.
api/core/model_providers/models/llm/base.py
View file @
a31466d3
import
json
import
json
import
os
import
os
import
re
import
re
import
time
from
abc
import
abstractmethod
from
abc
import
abstractmethod
from
typing
import
List
,
Optional
,
Any
,
Union
,
Tuple
from
typing
import
List
,
Optional
,
Any
,
Union
,
Tuple
import
decimal
import
decimal
...
@@ -20,6 +21,8 @@ from core.prompt.prompt_template import JinjaPromptTemplate
...
@@ -20,6 +21,8 @@ from core.prompt.prompt_template import JinjaPromptTemplate
from
core.third_party.langchain.llms.fake
import
FakeLLM
from
core.third_party.langchain.llms.fake
import
FakeLLM
import
logging
import
logging
from
extensions.ext_database
import
db
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -129,6 +132,8 @@ class BaseLLM(BaseProviderModel):
...
@@ -129,6 +132,8 @@ class BaseLLM(BaseProviderModel):
if
self
.
deduct_quota
:
if
self
.
deduct_quota
:
self
.
model_provider
.
check_quota_over_limit
()
self
.
model_provider
.
check_quota_over_limit
()
db
.
session
.
commit
()
if
not
callbacks
:
if
not
callbacks
:
callbacks
=
self
.
callbacks
callbacks
=
self
.
callbacks
else
:
else
:
...
...
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