fix: fix pytorch version to avoid wheel bug (#1123)

* fix: fix pytorch version

* fix: settings env var regex and split

* fix: add models folder for docker user
This commit is contained in:
Pablo Orgaz
2023-10-27 20:27:40 +02:00
committed by GitHub
parent 895588b82a
commit 24cfddd60f
5 changed files with 1150 additions and 480 deletions

View File

@@ -5,7 +5,7 @@ from typing import Any, TextIO
from yaml import SafeLoader
_env_replace_matcher = re.compile(r"\$\{(\w|_)+(:(\w|_)*)?}")
_env_replace_matcher = re.compile(r"\$\{(\w|_)+:?.*}")
@typing.no_type_check # pyaml does not have good hints, everything is Any
@@ -22,7 +22,7 @@ def load_yaml_with_envvars(
def load_env_var(_, node) -> str:
"""Extract the matched value, expand env variable, and replace the match."""
value = str(node.value).removeprefix("${").removesuffix("}")
split = value.split(":")
split = value.split(":", 1)
env_var = split[0]
value = environ.get(env_var)
default = None if len(split) == 1 else split[1]