Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
3e5b3c79
Commit
3e5b3c79
authored
Apr 17, 2023
by
siutin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace with #wrap_session_call
parent
98497006
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
modules/call_queue.py
modules/call_queue.py
+9
-7
No files found.
modules/call_queue.py
View file @
3e5b3c79
...
...
@@ -10,6 +10,11 @@ from modules import shared, progress
queue_lock
=
threading
.
Lock
()
queue_lock_condition
=
threading
.
Condition
(
lock
=
queue_lock
)
def
wrap_session_call
(
func
):
def
f
(
request
:
gr
.
Request
,
*
args
,
**
kwargs
):
return
func
(
request
,
*
args
,
**
kwargs
)
return
f
def
wrap_queued_call
(
func
):
def
f
(
*
args
,
**
kwargs
):
with
queue_lock
:
...
...
@@ -45,21 +50,18 @@ def wrap_gradio_gpu_call(func, extra_outputs=None):
return
res
return
wrap_
gradio_call
(
f
,
extra_outputs
=
extra_outputs
,
add_stats
=
True
,
add_request
=
True
)
return
wrap_
session_call
(
wrap_gradio_call
(
f
,
extra_outputs
=
extra_outputs
,
add_stats
=
True
)
)
def
wrap_gradio_call
(
func
,
extra_outputs
=
None
,
add_stats
=
False
,
add_request
=
False
):
def
f
(
request
:
gr
.
Request
,
*
args
,
extra_outputs_array
=
extra_outputs
,
**
kwargs
):
def
wrap_gradio_call
(
func
,
extra_outputs
=
None
,
add_stats
=
False
):
def
f
(
*
args
,
extra_outputs_array
=
extra_outputs
,
**
kwargs
):
run_memmon
=
shared
.
opts
.
memmon_poll_rate
>
0
and
not
shared
.
mem_mon
.
disabled
and
add_stats
if
run_memmon
:
shared
.
mem_mon
.
monitor
()
t
=
time
.
perf_counter
()
try
:
if
add_request
:
res
=
list
(
func
(
request
,
*
args
,
**
kwargs
))
else
:
res
=
list
(
func
(
*
args
,
**
kwargs
))
res
=
list
(
func
(
*
args
,
**
kwargs
))
except
Exception
as
e
:
# When printing out our debug argument list, do not print out more than a MB of text
max_debug_str_len
=
131072
# (1024*1024)/8
...
...
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