Skip to content

Commit

Permalink
Updating compatibility for Hydra 1.1 (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackUrb authored Jul 30, 2021
1 parent 57e6240 commit 4aff7a8
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/parlai_chat_task_demo/parlai_test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class TestScriptConfig(RunScriptConfig):
register_script_config(name="scriptconfig", module=TestScriptConfig)


@hydra.main(config_name="scriptconfig")
@hydra.main(config_path="hydra_configs", config_name="scriptconfig")
def main(cfg: DictConfig) -> None:
db, cfg = load_db_and_process_config(cfg)

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_static_task/static_run_with_onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TestScriptConfig(RunScriptConfig):
register_script_config(name="scriptconfig", module=TestScriptConfig)


@hydra.main(config_name="scriptconfig")
@hydra.main(config_path="hydra_configs", config_name="scriptconfig")
def main(cfg: DictConfig) -> None:
correct_config_answer = cfg.correct_answer

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_static_task/static_test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TestScriptConfig(RunScriptConfig):
register_script_config(name="scriptconfig", module=TestScriptConfig)


@hydra.main(config_name="scriptconfig")
@hydra.main(config_path="hydra_configs", config_name="scriptconfig")
def main(cfg: DictConfig) -> None:
db, cfg = load_db_and_process_config(cfg)
operator = Operator(db)
Expand Down
2 changes: 1 addition & 1 deletion examples/static_react_task/run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def build_task(task_dir):
os.chdir(return_dir)


@hydra.main(config_name="scriptconfig")
@hydra.main(config_path="hydra_configs", config_name="scriptconfig")
def main(cfg: DictConfig) -> None:
task_dir = cfg.task_dir

Expand Down
11 changes: 6 additions & 5 deletions mephisto/operations/hydra_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class DatabaseArgs:

@dataclass
class MephistoConfig:
blueprint: BlueprintArgs = BlueprintArgs()
provider: ProviderArgs = ProviderArgs()
architect: ArchitectArgs = ArchitectArgs()
blueprint: BlueprintArgs = MISSING
provider: ProviderArgs = MISSING
architect: ArchitectArgs = MISSING
task: TaskConfigArgs = TaskConfigArgs()
database: DatabaseArgs = DatabaseArgs()
log_level: str = "info"
Expand All @@ -38,7 +38,9 @@ class RunScriptConfig:

def register_abstraction_config(name: str, node: Any, abstraction_type: str):
config.store(
name=name, node=node, group=f"mephisto/{abstraction_type}", package="_group_"
name=name,
node=node,
group=f"mephisto/{abstraction_type}",
)


Expand All @@ -50,7 +52,6 @@ def initialize_named_configs():
name="base_mephisto_config",
node=MephistoConfig,
group="mephisto",
package="_group_",
)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ torch = {version = "^1.4.0", optional = true }
pyyaml = {version = "^5.3", optional = true }
gevent-websocket = "^0.10.1"
tabulate = "^0.8.7"
hydra-core = "^1.0.0"
hydra-core = "^1.1.0"
tqdm = "^4.50.2"
xmltodict = "^0.12.0"

Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ PyYAML==5.4.1 \
--hash=sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247 \
--hash=sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6 \
--hash=sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0
hydra-core==1.0.0 \
--hash=sha256:a1c513768fc3271aca0759023d680b19df31bb44442b508d64c77d07438def29 \
--hash=sha256:ea8dad523fced49b88f3472493a4ffee50bf4ffc51459a2372dc85184802bf71
omegaconf==2.0.2 \
--hash=sha256:3892d6a6848e1f54869d6ea3720f7208e4bb4276774f97dbb899fb540ac84506 \
--hash=sha256:dede7746b3dc18c5670dcec4ce283593d229a055a1c9cf089e2663545396fba0
hydra-core==1.1.0 \
--hash=sha256:22370397633af05db594d69d885ead0728039feaec1bb4f666643f811dc6d183 \
--hash=sha256:ef20f54c99d6061e1fffee33f43901eb7a09f23291f6bda56afe1c8f68033b2b
omegaconf==2.1.0 \
--hash=sha256:a08aec03a63c66449b550b85d70238f4dee9c6c4a0541d6a98845dcfeb12439d \
--hash=sha256:a9c576639f66793c874e32d17138ecce7a57e132a4537d2b6dff899d6958f956
importlib-resources==3.0.0; python_version < "3.9" \
--hash=sha256:19f745a6eca188b490b1428c8d1d4a0d2368759f32370ea8fb89cad2ab1106c3 \
--hash=sha256:d028f66b66c0d5732dae86ba4276999855e162a749c92620a38c1d779ed138a7
Expand Down

0 comments on commit 4aff7a8

Please sign in to comment.