Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
a721d201
Verified
Commit
a721d201
authored
2 years ago
by
Yoann Schneider
Browse files
Options
Downloads
Patches
Plain Diff
clearer comments about config serialization
parent
30a8efce
No related branches found
No related tags found
1 merge request
!60
Resume from existing mlflow run
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dan/ocr/document/train.py
+5
-1
5 additions, 1 deletion
dan/ocr/document/train.py
with
5 additions
and
1 deletion
dan/ocr/document/train.py
+
5
−
1
View file @
a721d201
...
...
@@ -239,7 +239,10 @@ def get_config():
def
serialize_config
(
config
):
"""
Serialize a dictionary to transform it into json and remove the credentials
Make every field of the configuration JSON-Serializable and remove sensitive information.
- Classes are transformed using their name attribute
- Functions are casted to strings
"""
# Create a copy of the original config without erase it
serialized_config
=
deepcopy
(
config
)
...
...
@@ -282,6 +285,7 @@ def serialize_config(config):
"
synthetic_data
"
in
config
[
"
dataset_params
"
][
"
config
"
]
and
config
[
"
dataset_params
"
][
"
config
"
][
"
synthetic_data
"
]
):
# The Probability scheduler is a function and needs to be casted to string
serialized_config
[
"
dataset_params
"
][
"
config
"
][
"
synthetic_data
"
][
"
proba_scheduler_function
"
]
=
str
(
...
...
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