From 82fd686df31190a4d8c6290adf0357dd7d11c931 Mon Sep 17 00:00:00 2001 From: Dillon Laird Date: Sat, 17 Feb 2024 18:04:46 -0800 Subject: [PATCH] make compatible with py <3.10 --- lmm_tools/lmm/lmm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmm_tools/lmm/lmm.py b/lmm_tools/lmm/lmm.py index e4c80032..c9c38945 100644 --- a/lmm_tools/lmm/lmm.py +++ b/lmm_tools/lmm/lmm.py @@ -4,7 +4,7 @@ from typing import Optional, Union -def encode_image(image: str | Path) -> str: +def encode_image(image: Union[str, Path]) -> str: with open(image, "rb") as f: encoded_image = base64.b64encode(f.read()).decode("utf-8") return encoded_image