Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emoUS-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
dsml
emoUS-public
Commits
0d233eee
Commit
0d233eee
authored
Nov 29, 2022
by
Carel van Niekerk
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix and update downloader for setsumbt
parent
bd7a47d0
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
convlab/dst/setsumbt/do/nbt.py
+19
-0
19 additions, 0 deletions
convlab/dst/setsumbt/do/nbt.py
convlab/dst/setsumbt/tracker.py
+2
-2
2 additions, 2 deletions
convlab/dst/setsumbt/tracker.py
with
21 additions
and
2 deletions
convlab/dst/setsumbt/do/nbt.py
+
19
−
0
View file @
0d233eee
...
...
@@ -20,6 +20,7 @@ import os
from
shutil
import
copy2
as
copy
import
json
from
copy
import
deepcopy
import
pdb
import
torch
import
transformers
...
...
@@ -34,6 +35,7 @@ from convlab.dst.setsumbt.modeling import training
from
convlab.dst.setsumbt.dataset
import
ontology
as
embeddings
from
convlab.dst.setsumbt.utils
import
get_args
,
update_args
from
convlab.dst.setsumbt.modeling.ensemble_nbt
import
setup_ensemble
from
convlab.util.custom_util
import
model_downloader
# Available model
...
...
@@ -55,6 +57,23 @@ def main(args=None, config=None):
# Set up output directory
OUTPUT_DIR
=
args
.
output_dir
# Download model if needed
if
not
os
.
path
.
exists
(
OUTPUT_DIR
):
# Get path /.../convlab/dst/setsumbt/multiwoz/models
download_path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
download_path
=
os
.
path
.
join
(
download_path
,
'
models
'
)
if
not
os
.
path
.
exists
(
download_path
):
os
.
mkdir
(
download_path
)
model_downloader
(
download_path
,
OUTPUT_DIR
)
# Downloadable model path format http://.../model_name.zip
OUTPUT_DIR
=
OUTPUT_DIR
.
split
(
'
/
'
)[
-
1
].
replace
(
'
.zip
'
,
''
)
OUTPUT_DIR
=
os
.
path
.
join
(
download_path
,
OUTPUT_DIR
)
args
.
tensorboard_path
=
os
.
path
.
join
(
OUTPUT_DIR
,
args
.
tensorboard_path
.
split
(
'
/
'
)[
-
1
])
args
.
logging_path
=
os
.
path
.
join
(
OUTPUT_DIR
,
args
.
logging_path
.
split
(
'
/
'
)[
-
1
])
os
.
mkdir
(
os
.
path
.
join
(
OUTPUT_DIR
,
'
dataloaders
'
))
if
not
os
.
path
.
exists
(
OUTPUT_DIR
):
os
.
makedirs
(
OUTPUT_DIR
)
os
.
mkdir
(
os
.
path
.
join
(
OUTPUT_DIR
,
'
database
'
))
...
...
This diff is collapsed.
Click to expand it.
convlab/dst/setsumbt/tracker.py
+
2
−
2
View file @
0d233eee
...
...
@@ -61,8 +61,8 @@ class SetSUMBTTracker(DST):
if
not
os
.
path
.
exists
(
download_path
):
os
.
mkdir
(
download_path
)
model_downloader
(
download_path
,
self
.
model_path
)
# Downloadable model path format http://.../
setsumbt_
model_name.zip
self
.
model_path
=
self
.
model_path
.
split
(
'
/
'
)[
-
1
].
split
(
'
_
'
,
1
)[
-
1
].
replace
(
'
.zip
'
,
''
)
# Downloadable model path format http://.../model_name.zip
self
.
model_path
=
self
.
model_path
.
split
(
'
/
'
)[
-
1
].
replace
(
'
.zip
'
,
''
)
self
.
model_path
=
os
.
path
.
join
(
download_path
,
self
.
model_path
)
# Select model type based on the encoder
...
...
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