Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
0a8de9c8
Commit
0a8de9c8
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Merged in server script and API
parent
e6ba8694
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
model_server/api.py
+0
-0
0 additions, 0 deletions
model_server/api.py
run_server.py
+0
-7
0 additions, 7 deletions
run_server.py
scripts/run_server.py
+52
-0
52 additions, 0 deletions
scripts/run_server.py
with
52 additions
and
7 deletions
api.py
→
model_server/
api.py
+
0
−
0
View file @
0a8de9c8
File moved
This diff is collapsed.
Click to expand it.
run_server.py
deleted
100644 → 0
+
0
−
7
View file @
e6ba8694
import
uvicorn
host
=
'
127.0.0.1
'
port
=
8001
if
__name__
==
'
__main__
'
:
uvicorn
.
run
(
'
api:app
'
,
**
{
'
host
'
:
host
,
'
port
'
:
port
,
'
log_level
'
:
'
debug
'
},
reload
=
False
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/run_server.py
0 → 100644
+
52
−
0
View file @
0a8de9c8
import
argparse
from
multiprocessing
import
Process
import
uvicorn
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
description
=
'
Start model server with optional arguments
'
,
)
parser
.
add_argument
(
'
--host
'
,
default
=
'
127.0.0.1
'
,
help
=
'
bind socket to this host
'
)
parser
.
add_argument
(
'
--port
'
,
default
=
'
8000
'
,
help
=
'
bind socket to this port, default=8000
'
,
)
parser
.
add_argument
(
'
--debug
'
,
action
=
'
store_true
'
,
help
=
'
display extra information that is helpful for debugging
'
)
return
parser
.
parse_args
()
if
__name__
==
'
__main__
'
:
args
=
parse_args
()
print
(
'
CLI args:
\n
'
+
str
(
args
))
server_process
=
Process
(
target
=
uvicorn
.
run
,
args
=
(
'
model_server.api:app
'
,),
kwargs
=
{
'
app_dir
'
:
'
.
'
,
'
host
'
:
args
.
host
,
'
port
'
:
int
(
args
.
port
),
'
log_level
'
:
'
debug
'
,
'
reload
'
:
False
},
daemon
=
True
,
)
server_process
.
start
()
if
args
.
debug
:
print
(
'
Running in debug mode
'
)
print
(
'
Type
"
STOP
"
to stop server
'
)
input_str
=
''
while
input_str
.
upper
()
!=
'
STOP
'
:
input_str
=
input
()
print
(
'
Finished
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment