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
86b99b1e
Commit
86b99b1e
authored
Nov 24, 2023
by
Jabasukuriputo Wang
Committed by
GitHub
Nov 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move exception_records related methods to errors.py
parent
959404e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
18 deletions
+17
-18
modules/errors.py
modules/errors.py
+16
-2
modules/sysinfo.py
modules/sysinfo.py
+1
-16
No files found.
modules/errors.py
View file @
86b99b1e
...
...
@@ -6,6 +6,21 @@ import traceback
exception_records
=
[]
def
format_traceback
(
tb
):
return
[[
f
"{x.filename}, line {x.lineno}, {x.name}"
,
x
.
line
]
for
x
in
traceback
.
extract_tb
(
tb
)]
def
format_exception
(
e
,
tb
):
return
{
"exception"
:
str
(
e
),
"traceback"
:
format_traceback
(
tb
)}
def
get_exceptions
():
try
:
return
list
(
reversed
(
exception_records
))
except
Exception
as
e
:
return
str
(
e
)
def
record_exception
():
_
,
e
,
tb
=
sys
.
exc_info
()
if
e
is
None
:
...
...
@@ -14,8 +29,7 @@ def record_exception():
if
exception_records
and
exception_records
[
-
1
]
==
e
:
return
from
modules
import
sysinfo
exception_records
.
append
(
sysinfo
.
format_exception
(
e
,
tb
))
exception_records
.
append
(
format_exception
(
e
,
tb
))
if
len
(
exception_records
)
>
5
:
exception_records
.
pop
(
0
)
...
...
modules/sysinfo.py
View file @
86b99b1e
...
...
@@ -85,7 +85,7 @@ def get_dict():
"Checksum"
:
checksum_token
,
"Commandline"
:
sys
.
argv
,
"Torch env info"
:
get_torch_sysinfo
(),
"Exceptions"
:
get_exceptions
(),
"Exceptions"
:
errors
.
get_exceptions
(),
"CPU"
:
{
"model"
:
platform
.
processor
(),
"count logical"
:
psutil
.
cpu_count
(
logical
=
True
),
...
...
@@ -105,21 +105,6 @@ def get_dict():
return
res
def
format_traceback
(
tb
):
return
[[
f
"{x.filename}, line {x.lineno}, {x.name}"
,
x
.
line
]
for
x
in
traceback
.
extract_tb
(
tb
)]
def
format_exception
(
e
,
tb
):
return
{
"exception"
:
str
(
e
),
"traceback"
:
format_traceback
(
tb
)}
def
get_exceptions
():
try
:
return
list
(
reversed
(
errors
.
exception_records
))
except
Exception
as
e
:
return
str
(
e
)
def
get_environment
():
return
{
k
:
os
.
environ
[
k
]
for
k
in
sorted
(
os
.
environ
)
if
k
in
environment_whitelist
}
...
...
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