Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
model_server
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
Christopher Randolph Rhodes
model_server
Commits
2a81f7a7
Commit
2a81f7a7
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Bypass changing paths if new path is the same as old one
parent
d5e09c44
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
model_server/api.py
+2
-0
2 additions, 0 deletions
model_server/api.py
model_server/util.py
+4
-0
4 additions, 0 deletions
model_server/util.py
tests/test_api.py
+17
-1
17 additions, 1 deletion
tests/test_api.py
with
23 additions
and
1 deletion
model_server/api.py
+
2
−
0
View file @
2a81f7a7
...
...
@@ -30,6 +30,8 @@ def list_session_paths():
def
change_path
(
key
,
path
):
try
:
if
session
.
get_paths
()[
key
]
==
path
:
return
session
.
get_paths
()
session
.
set_data_directory
(
key
,
path
)
except
InvalidPathError
as
e
:
raise
HTTPException
(
...
...
This diff is collapsed.
Click to expand it.
model_server/util.py
+
4
−
0
View file @
2a81f7a7
from
pathlib
import
Path
import
re
from
time
import
localtime
,
strftime
from
typing
import
List
import
pandas
as
pd
from
model_server.accessors
import
InMemoryDataAccessor
,
write_accessor_data_to_file
from
model_server.models
import
Model
def
autonumber_new_directory
(
where
:
str
,
prefix
:
str
)
->
str
:
"""
...
...
@@ -75,6 +77,7 @@ def loop_workflow(
files
:
list
,
output_folder_path
:
str
,
workflow_func
:
callable
,
models
:
List
[
Model
],
params
:
dict
,
export_batch_csvs
:
bool
=
True
,
write_intermediate_products
:
bool
=
True
,
...
...
@@ -95,6 +98,7 @@ def loop_workflow(
export_kwargs
=
{
'
input_file_path
'
:
ff
,
'
output_folder_path
'
:
output_folder_path
,
'
models
'
:
models
,
**
params
,
}
...
...
This diff is collapsed.
Click to expand it.
tests/test_api.py
+
17
−
1
View file @
2a81f7a7
...
...
@@ -155,4 +155,20 @@ class TestApiFromAutomatedClient(TestServerBaseClass):
resp_check
=
requests
.
get
(
self
.
uri
+
'
paths
'
)
self
.
assertEqual
(
resp_inpath
.
json
()[
'
inbound_images
'
],
resp_check
.
json
()[
'
inbound_images
'
])
\ No newline at end of file
self
.
assertEqual
(
resp_inpath
.
json
()[
'
outbound_images
'
],
resp_check
.
json
()[
'
outbound_images
'
])
def
test_no_change_inbound_path
(
self
):
resp_inpath
=
requests
.
get
(
self
.
uri
+
'
paths
'
)
resp_change
=
requests
.
put
(
self
.
uri
+
f
'
paths/watch_output
'
,
params
=
{
'
path
'
:
resp_inpath
.
json
()[
'
outbound_images
'
]
}
)
self
.
assertEqual
(
resp_change
.
status_code
,
200
)
resp_check
=
requests
.
get
(
self
.
uri
+
'
paths
'
)
self
.
assertEqual
(
resp_inpath
.
json
()[
'
outbound_images
'
],
resp_check
.
json
()[
'
outbound_images
'
])
\ No newline at end of file
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