Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
16af3640
Commit
16af3640
authored
1 year ago
by
Maja Jablonska
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some parameter overriding bugs
parent
557b09e2
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!46
Merge COMBO 3.0 into master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
combo/config/from_parameters.py
+2
-2
2 additions, 2 deletions
combo/config/from_parameters.py
combo/main.py
+26
-8
26 additions, 8 deletions
combo/main.py
with
28 additions
and
10 deletions
combo/config/from_parameters.py
+
2
−
2
View file @
16af3640
...
...
@@ -216,8 +216,8 @@ def override_parameters(parameters: Dict[str, Any], override_values: Dict[str, A
overriden_parameters
=
flatten_dictionary
(
parameters
)
override_values
=
flatten_dictionary
(
override_values
)
for
ko
,
vo
in
override_values
.
items
():
if
ko
in
overriden_parameters
:
overriden_parameters
[
ko
]
=
vo
#
if ko in overriden_parameters:
overriden_parameters
[
ko
]
=
vo
return
unflatten_dictionary
(
overriden_parameters
)
...
...
This diff is collapsed.
Click to expand it.
combo/main.py
+
26
−
8
View file @
16af3640
...
...
@@ -154,7 +154,11 @@ def get_defaults(dataset_reader: Optional[DatasetReader],
or
not
training_data_loader
or
(
FLAGS
.
validation_data_path
and
not
validation_data_loader
)):
# Dataset reader is required to read training data and/or for training (and validation) data loader
dataset_reader
=
default_ud_dataset_reader
(
FLAGS
.
pretrained_transformer_name
)
dataset_reader
=
default_ud_dataset_reader
(
FLAGS
.
pretrained_transformer_name
,
tokenizer
=
LamboTokenizer
(
FLAGS
.
tokenizer_language
,
default_turns
=
FLAGS
.
turns
,
default_split_subwords
=
FLAGS
.
split_subwords
)
)
if
not
training_data_loader
:
training_data_loader
=
default_data_loader
(
dataset_reader
,
training_data_path
)
...
...
@@ -399,9 +403,9 @@ def run(_):
logger
.
info
(
"
No dataset reader in the configuration or archive file - using a default UD dataset reader
"
,
prefix
=
prefix
)
dataset_reader
=
default_ud_dataset_reader
(
FLAGS
.
pretrained_transformer_name
,
LamboTokenizer
(
tokenizer_language
,
default_turns
=
FLAGS
.
turns
,
default_split_subwords
=
FLAGS
.
split_subwords
)
tokenizer
=
LamboTokenizer
(
tokenizer_language
,
default_turns
=
FLAGS
.
turns
,
default_split_subwords
=
FLAGS
.
split_subwords
)
)
predictor
=
COMBO
(
model
,
dataset_reader
)
...
...
@@ -491,7 +495,12 @@ def _get_ext_vars(finetuning: bool = False) -> Dict:
"
reader
"
:
{
"
parameters
"
:
{
"
features
"
:
FLAGS
.
features
,
"
targets
"
:
FLAGS
.
targets
"
targets
"
:
FLAGS
.
targets
,
"
tokenizer
"
:
{
"
parameters
"
:
{
"
language
"
:
FLAGS
.
tokenizer_language
}
}
}
}
}
...
...
@@ -504,7 +513,12 @@ def _get_ext_vars(finetuning: bool = False) -> Dict:
"
reader
"
:
{
"
parameters
"
:
{
"
features
"
:
FLAGS
.
features
,
"
targets
"
:
FLAGS
.
targets
"
targets
"
:
FLAGS
.
targets
,
"
tokenizer
"
:
{
"
parameters
"
:
{
"
language
"
:
FLAGS
.
tokenizer_language
}
}
}
}
}
...
...
@@ -512,7 +526,12 @@ def _get_ext_vars(finetuning: bool = False) -> Dict:
"
dataset_reader
"
:
{
"
parameters
"
:
{
"
features
"
:
FLAGS
.
features
,
"
targets
"
:
FLAGS
.
targets
"
targets
"
:
FLAGS
.
targets
,
"
tokenizer
"
:
{
"
parameters
"
:
{
"
language
"
:
FLAGS
.
tokenizer_language
}
}
}
}
}
...
...
@@ -526,7 +545,6 @@ def _get_ext_vars(finetuning: bool = False) -> Dict:
"
oov_token
"
:
"
_
"
}
}
return
to_override
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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