Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
naifu
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
naifu
Commits
f3550054
Commit
f3550054
authored
Oct 17, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow os kill
parent
e9954cd2
Pipeline
#17213
passed with stages
in 20 minutes and 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main.py
main.py
+4
-4
No files found.
main.py
View file @
f3550054
...
...
@@ -216,7 +216,7 @@ def generate(request: GenerationRequest, authorized: bool = Depends(verify_token
if
"CUDA out of memory"
in
e_s
or
\
"an illegal memory access"
in
e_s
or
"CUDA"
in
e_s
:
logger
.
error
(
"GPU error, committing seppuku."
)
#
os.kill(mainpid, signal.SIGTERM)
os
.
kill
(
mainpid
,
signal
.
SIGTERM
)
return
{
"error"
:
str
(
e
)}
@
app
.
post
(
'/generate'
,
response_model
=
Union
[
GenerationOutput
,
ErrorOutput
])
...
...
@@ -267,7 +267,7 @@ def generate(request: GenerationRequest, authorized: bool = Depends(verify_token
if
"CUDA out of memory"
in
e_s
or
\
"an illegal memory access"
in
e_s
or
"CUDA"
in
e_s
:
logger
.
error
(
"GPU error, committing seppuku."
)
#
os.kill(mainpid, signal.SIGTERM)
os
.
kill
(
mainpid
,
signal
.
SIGTERM
)
return
{
"error"
:
str
(
e
)}
@
app
.
post
(
'/generate-text'
,
response_model
=
Union
[
TextOutput
,
ErrorOutput
])
...
...
@@ -294,7 +294,7 @@ def generate_text(request: TextRequest, authorized: bool = Depends(verify_token)
if
"CUDA out of memory"
in
e_s
or
\
"an illegal memory access"
in
e_s
or
"CUDA"
in
e_s
:
logger
.
error
(
"GPU error, committing seppuku."
)
#
os.kill(mainpid, signal.SIGTERM)
os
.
kill
(
mainpid
,
signal
.
SIGTERM
)
return
ErrorOutput
(
error
=
str
(
e
))
@
app
.
get
(
'/predict-tags'
,
response_model
=
Union
[
TagOutput
,
ErrorOutput
])
...
...
@@ -321,7 +321,7 @@ async def predict_tags(prompt="", authorized: bool = Depends(verify_token)):
if
"CUDA out of memory"
in
e_s
or
\
"an illegal memory access"
in
e_s
or
"CUDA"
in
e_s
:
logger
.
error
(
"GPU error, committing seppuku."
)
#
os.kill(mainpid, signal.SIGTERM)
os
.
kill
(
mainpid
,
signal
.
SIGTERM
)
return
ErrorOutput
(
error
=
str
(
e
))
#@app.get('/')
...
...
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