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
53765257
"src/vscode:/vscode.git/clone" did not exist on "55cb7d3a3f9202fea5719e67e1f886e09a882861"
Commit
53765257
authored
May 19, 2024
by
Timothy J. Baek
Browse files
refac
parent
82bd1eb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
backend/apps/rag/main.py
backend/apps/rag/main.py
+13
-1
No files found.
backend/apps/rag/main.py
View file @
53765257
...
...
@@ -69,6 +69,7 @@ from utils.misc import (
from
utils.utils
import
get_current_user
,
get_admin_user
from
config
import
(
ENV
,
SRC_LOG_LEVELS
,
UPLOAD_DIR
,
DOCS_DIR
,
...
...
@@ -260,7 +261,7 @@ async def update_embedding_config(
app
.
state
.
config
.
OPENAI_API_BASE_URL
=
form_data
.
openai_config
.
url
app
.
state
.
config
.
OPENAI_API_KEY
=
form_data
.
openai_config
.
key
update_embedding_model
(
app
.
state
.
config
.
RAG_EMBEDDING_MODEL
)
,
True
update_embedding_model
(
app
.
state
.
config
.
RAG_EMBEDDING_MODEL
)
app
.
state
.
EMBEDDING_FUNCTION
=
get_embedding_function
(
app
.
state
.
config
.
RAG_EMBEDDING_ENGINE
,
...
...
@@ -951,3 +952,14 @@ def reset(user=Depends(get_admin_user)) -> bool:
log
.
exception
(
e
)
return
True
if
ENV
==
"dev"
:
@
app
.
get
(
"/ef"
)
async
def
get_embeddings
():
return
{
"result"
:
app
.
state
.
EMBEDDING_FUNCTION
(
"hello world"
)}
@
app
.
get
(
"/ef/{text}"
)
async
def
get_embeddings_text
(
text
:
str
):
return
{
"result"
:
app
.
state
.
EMBEDDING_FUNCTION
(
text
)}
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