Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
01c4647d
Commit
01c4647d
authored
Apr 27, 2024
by
Timothy J. Baek
Browse files
fix: ollama version string issue
#1800
parent
85e94cc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+4
-1
No files found.
backend/apps/ollama/main.py
View file @
01c4647d
...
@@ -16,6 +16,7 @@ from fastapi.concurrency import run_in_threadpool
...
@@ -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):
...
@@ -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"
]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment