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
e6bbce43
"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "eb5ed905eb33bf1fc6ecf20df752042d7bd9f7bf"
Commit
e6bbce43
authored
Aug 08, 2024
by
Michael Poluektov
Browse files
fix: repeat_penalty
parent
670f28d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
backend/apps/ollama/main.py
backend/apps/ollama/main.py
+0
-3
backend/utils/misc.py
backend/utils/misc.py
+6
-1
No files found.
backend/apps/ollama/main.py
View file @
e6bbce43
...
@@ -31,8 +31,6 @@ from utils.utils import (
...
@@ -31,8 +31,6 @@ from utils.utils import (
get_verified_user
,
get_verified_user
,
get_admin_user
,
get_admin_user
,
)
)
from
utils.task
import
prompt_template
from
config
import
(
from
config
import
(
SRC_LOG_LEVELS
,
SRC_LOG_LEVELS
,
...
@@ -47,7 +45,6 @@ from config import (
...
@@ -47,7 +45,6 @@ from config import (
from
utils.misc
import
(
from
utils.misc
import
(
apply_model_params_to_body_ollama
,
apply_model_params_to_body_ollama
,
calculate_sha256
,
calculate_sha256
,
add_or_update_system_message
,
apply_model_params_to_body_openai
,
apply_model_params_to_body_openai
,
apply_model_system_prompt_to_body
,
apply_model_system_prompt_to_body
,
)
)
...
...
backend/utils/misc.py
View file @
e6bbce43
...
@@ -181,7 +181,12 @@ def apply_model_params_to_body_ollama(params: dict, form_data: dict) -> dict:
...
@@ -181,7 +181,12 @@ def apply_model_params_to_body_ollama(params: dict, form_data: dict) -> dict:
]
]
mappings
=
{
i
:
lambda
x
:
x
for
i
in
opts
}
mappings
=
{
i
:
lambda
x
:
x
for
i
in
opts
}
mappings
=
{
**
mappings
,
**
OPENAI_MAPPINGS
}
mappings
=
{
**
mappings
,
**
OPENAI_MAPPINGS
}
return
apply_model_params_to_body
(
params
,
form_data
,
mappings
)
form_data
=
apply_model_params_to_body
(
params
,
form_data
,
mappings
)
# only param that changes name
if
(
param
:
=
params
.
get
(
"frequency_penalty"
,
None
))
is
not
None
:
form_data
[
"repeat_penalty"
]
=
param
return
form_data
def
get_gravatar_url
(
email
):
def
get_gravatar_url
(
email
):
...
...
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