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
d527efc6
Commit
d527efc6
authored
Oct 15, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no server kill
parent
72e49d5f
Pipeline
#17176
passed with stages
in 14 minutes and 27 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
5 deletions
+14
-5
.dockerignore
.dockerignore
+1
-0
Dockerfile
Dockerfile
+1
-1
docker-compose.yml
docker-compose.yml
+8
-0
main.py
main.py
+4
-4
No files found.
.dockerignore
View file @
d527efc6
...
...
@@ -6,3 +6,4 @@ Dockerfile
/*.sh
/models
/static
/docker-compose.yml
Dockerfile
View file @
d527efc6
...
...
@@ -6,7 +6,7 @@ RUN apt update && apt -y install python3-pip python-is-python3 && \
WORKDIR
/app
COPY
./requirements.txt ./
RUN
pip
install
-r
requirements.txt
RUN
pip
install
-
-no-cache
-
r
requirements.txt
COPY
. ./
...
...
docker-compose.yml
0 → 100644
View file @
d527efc6
version
:
'
2.4'
services
:
naifu
:
build
:
'
.'
network_mode
:
host
runtime
:
nvidia
volumes
:
-
./models:/app/models
main.py
View file @
d527efc6
...
...
@@ -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