Slackbot
01/26/2024, 7:28 AMChris
01/26/2024, 7:46 AM@classmethod
def from_str(cls, tag_str: str) -> "Tag":
tag_str = tag_str.rstrip()
it works..... but it is not clean...Jian Shen Yap
01/26/2024, 8:11 AMsauyon
01/26/2024, 8:12 AMChris
01/26/2024, 8:12 AMJian Shen Yap
01/26/2024, 8:13 AMsvc = bentoml.Service("p05_s1_anomaly_service", runners=runner_list)
^Chris
01/26/2024, 8:13 AMsauyon
01/26/2024, 8:14 AMChris
01/26/2024, 8:15 AMJian Shen Yap
01/26/2024, 8:18 AMChris
01/26/2024, 8:20 AMChris
01/26/2024, 8:24 AMChris
01/26/2024, 8:33 AMChris
01/26/2024, 8:39 AMdef _parse_tag_from_outputs(output: bytes) -> str:
matched = re.search(
r"^__tag__:([^:\n]+:[^:\n]+)$",
output.decode("utf-8").strip(),
flags=re.MULTILINE,
)
if matched is None:
raise BentoMLException(
f"Failed to find tag from output: {output}\nNote: Output from 'bentoml build' might not be correct. Please open an issue on GitHub."
)
return matched.group(1).strip() ## Add rstrip to remove trailing \r
If you add the strip() command in the return argument, it works. Somehow the regex produces this.. maybe the MULTILINE argument?Chris
01/26/2024, 10:01 AM