Skip to content
Snippets Groups Projects
Commit 30f615b9 authored by Christian's avatar Christian
Browse files

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
...@@ -3,7 +3,6 @@ import os ...@@ -3,7 +3,6 @@ import os
import sys import sys
import numpy as np import numpy as np
from data.unified_datasets.multiwoz21.database import Database
from copy import deepcopy from copy import deepcopy
from convlab.policy.vec import Vector from convlab.policy.vec import Vector
from convlab.util.custom_util import flatten_acts from convlab.util.custom_util import flatten_acts
...@@ -26,8 +25,11 @@ class VectorBase(Vector): ...@@ -26,8 +25,11 @@ class VectorBase(Vector):
self.set_seed(seed) self.set_seed(seed)
self.ontology = load_ontology(dataset_name) self.ontology = load_ontology(dataset_name)
try: try:
#self.db = load_database(dataset_name) # execute to make sure that the database exists or is downloaded otherwise
self.db = Database() 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 self.db_domains = self.db.domains
except Exception as e: except Exception as e:
self.db = None self.db = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment