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
0334ab7c
Unverified
Commit
0334ab7c
authored
May 06, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 06, 2024
Browse files
Merge pull request #2001 from cheahjs/feat/limit-title-gen-tokens
feat: restrict title gen output to 50 tokens
parents
e92311b4
b8c97fa0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
src/lib/apis/ollama/index.ts
src/lib/apis/ollama/index.ts
+5
-1
src/lib/apis/openai/index.ts
src/lib/apis/openai/index.ts
+3
-1
No files found.
src/lib/apis/ollama/index.ts
View file @
0334ab7c
...
@@ -159,7 +159,11 @@ export const generateTitle = async (
...
@@ -159,7 +159,11 @@ export const generateTitle = async (
body
:
JSON
.
stringify
({
body
:
JSON
.
stringify
({
model
:
model
,
model
:
model
,
prompt
:
template
,
prompt
:
template
,
stream
:
false
stream
:
false
,
options
:
{
// Restrict the number of tokens generated to 50
num_predict
:
50
,
}
})
})
})
})
.
then
(
async
(
res
)
=>
{
.
then
(
async
(
res
)
=>
{
...
...
src/lib/apis/openai/index.ts
View file @
0334ab7c
...
@@ -295,7 +295,9 @@ export const generateTitle = async (
...
@@ -295,7 +295,9 @@ export const generateTitle = async (
content
:
template
content
:
template
}
}
],
],
stream
:
false
stream
:
false
,
// Restricting the max tokens to 50 to avoid long titles
max_tokens
:
50
,
})
})
})
})
.
then
(
async
(
res
)
=>
{
.
then
(
async
(
res
)
=>
{
...
...
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