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
395ca821
Commit
395ca821
authored
Apr 06, 2024
by
Timothy J. Baek
Browse files
refac: '-rc' tag handling
parent
c9f17ecb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+14
-3
No files found.
backend/apps/ollama/main.py
View file @
395ca821
...
...
@@ -33,7 +33,13 @@ from constants import ERROR_MESSAGES
from
utils.utils
import
decode_token
,
get_current_user
,
get_admin_user
from
config
import
SRC_LOG_LEVELS
,
OLLAMA_BASE_URLS
,
MODEL_FILTER_ENABLED
,
MODEL_FILTER_LIST
,
UPLOAD_DIR
from
config
import
(
SRC_LOG_LEVELS
,
OLLAMA_BASE_URLS
,
MODEL_FILTER_ENABLED
,
MODEL_FILTER_LIST
,
UPLOAD_DIR
,
)
from
utils.misc
import
calculate_sha256
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -203,7 +209,8 @@ 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"
].
replace
(
"-rc"
,
"."
).
split
(
"."
)))
responses
,
key
=
lambda
x
:
tuple
(
map
(
int
,
x
[
"version"
].
split
(
"-"
)[
0
].
split
(
"."
))),
)
return
{
"version"
:
lowest_version
[
"version"
]}
...
...
@@ -770,7 +777,11 @@ async def generate_chat_completion(
r
=
None
log
.
debug
(
"form_data.model_dump_json(exclude_none=True).encode(): {0} "
.
format
(
form_data
.
model_dump_json
(
exclude_none
=
True
).
encode
()))
log
.
debug
(
"form_data.model_dump_json(exclude_none=True).encode(): {0} "
.
format
(
form_data
.
model_dump_json
(
exclude_none
=
True
).
encode
()
)
)
def
get_request
():
nonlocal
form_data
...
...
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