allow version to work with -rc tag

This commit is contained in:
Joseph C Wang 2024-03-29 01:44:37 +08:00
parent ac294a74e7
commit c9f17ecb3a

View file

@ -203,7 +203,7 @@ async def get_ollama_versions(url_idx: Optional[int] = None):
if len(responses) > 0:
lowest_version = min(
responses, key=lambda x: tuple(map(int, x["version"].split(".")))
responses, key=lambda x: tuple(map(int, x["version"].replace("-rc", ".").split(".")))
)
return {"version": lowest_version["version"]}