mirror of
https://github.com/open-webui/open-webui
synced 2024-11-26 14:02:29 +00:00
parent
85e94cc259
commit
01c4647dfc
@ -16,6 +16,7 @@ from fastapi.concurrency import run_in_threadpool
|
|||||||
from pydantic import BaseModel, ConfigDict
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import copy
|
import copy
|
||||||
import random
|
import random
|
||||||
import requests
|
import requests
|
||||||
@ -216,7 +217,9 @@ async def get_ollama_versions(url_idx: Optional[int] = None):
|
|||||||
if len(responses) > 0:
|
if len(responses) > 0:
|
||||||
lowest_version = min(
|
lowest_version = min(
|
||||||
responses,
|
responses,
|
||||||
key=lambda x: tuple(map(int, x["version"].split("-")[0].split("."))),
|
key=lambda x: tuple(
|
||||||
|
map(int, re.sub(r"^v|-.*", "", x["version"]).split("."))
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return {"version": lowest_version["version"]}
|
return {"version": lowest_version["version"]}
|
||||||
|
Loading…
Reference in New Issue
Block a user