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
30f615b9
Commit
30f615b9
authored
2 years ago
by
Christian
Browse files
Options
Downloads
Patches
Plain Diff
solved by 1) ensuring database exists or is downloaded and 2) import using exec python method
parent
246bba6f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
convlab/policy/vector/vector_base.py
+5
-3
5 additions, 3 deletions
convlab/policy/vector/vector_base.py
with
5 additions
and
3 deletions
convlab/policy/vector/vector_base.py
+
5
−
3
View file @
30f615b9
...
...
@@ -3,7 +3,6 @@ import os
import
sys
import
numpy
as
np
from
data.unified_datasets.multiwoz21.database
import
Database
from
copy
import
deepcopy
from
convlab.policy.vec
import
Vector
from
convlab.util.custom_util
import
flatten_acts
...
...
@@ -26,8 +25,11 @@ class VectorBase(Vector):
self
.
set_seed
(
seed
)
self
.
ontology
=
load_ontology
(
dataset_name
)
try
:
#self.db = load_database(dataset_name)
self
.
db
=
Database
()
# execute to make sure that the database exists or is downloaded otherwise
load_database
(
dataset_name
)
# the following two lines are needed for pickling correctly during multi-processing
exec
(
f
'
from data.unified_datasets.
{
dataset_name
}
.database import Database
'
)
self
.
db
=
eval
(
'
Database()
'
)
self
.
db_domains
=
self
.
db
.
domains
except
Exception
as
e
:
self
.
db
=
None
...
...
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