Commit 9be56d68 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

refac: naming convention

parent 99a43cc9
...@@ -48,7 +48,7 @@ from apps.web.models.documents import ( ...@@ -48,7 +48,7 @@ from apps.web.models.documents import (
from apps.rag.utils import ( from apps.rag.utils import (
get_model_path, get_model_path,
query_embeddings_doc, query_embeddings_doc,
query_embeddings_function, get_embeddings_function,
query_embeddings_collection, query_embeddings_collection,
) )
...@@ -367,7 +367,7 @@ def query_doc_handler( ...@@ -367,7 +367,7 @@ def query_doc_handler(
user=Depends(get_current_user), user=Depends(get_current_user),
): ):
try: try:
embeddings_function = query_embeddings_function( embeddings_function = get_embeddings_function(
app.state.RAG_EMBEDDING_ENGINE, app.state.RAG_EMBEDDING_ENGINE,
app.state.RAG_EMBEDDING_MODEL, app.state.RAG_EMBEDDING_MODEL,
app.state.sentence_transformer_ef, app.state.sentence_transformer_ef,
...@@ -410,7 +410,7 @@ def query_collection_handler( ...@@ -410,7 +410,7 @@ def query_collection_handler(
user=Depends(get_current_user), user=Depends(get_current_user),
): ):
try: try:
embeddings_function = query_embeddings_function( embeddings_function = get_embeddings_function(
app.state.RAG_EMBEDDING_ENGINE, app.state.RAG_EMBEDDING_ENGINE,
app.state.RAG_EMBEDDING_MODEL, app.state.RAG_EMBEDDING_MODEL,
app.state.sentence_transformer_ef, app.state.sentence_transformer_ef,
...@@ -508,7 +508,7 @@ def store_docs_in_vector_db(docs, collection_name, overwrite: bool = False) -> b ...@@ -508,7 +508,7 @@ def store_docs_in_vector_db(docs, collection_name, overwrite: bool = False) -> b
collection = CHROMA_CLIENT.create_collection(name=collection_name) collection = CHROMA_CLIENT.create_collection(name=collection_name)
embedding_func = query_embeddings_function( embedding_func = get_embeddings_function(
app.state.RAG_EMBEDDING_ENGINE, app.state.RAG_EMBEDDING_ENGINE,
app.state.RAG_EMBEDDING_MODEL, app.state.RAG_EMBEDDING_MODEL,
app.state.sentence_transformer_ef, app.state.sentence_transformer_ef,
......
...@@ -164,7 +164,7 @@ def rag_template(template: str, context: str, query: str): ...@@ -164,7 +164,7 @@ def rag_template(template: str, context: str, query: str):
return template return template
def query_embeddings_function( def get_embeddings_function(
embedding_engine, embedding_engine,
embedding_model, embedding_model,
embedding_function, embedding_function,
...@@ -243,7 +243,7 @@ def rag_messages( ...@@ -243,7 +243,7 @@ def rag_messages(
content_type = None content_type = None
query = "" query = ""
embeddings_function = query_embeddings_function( embeddings_function = get_embeddings_function(
embedding_engine, embedding_engine,
embedding_model, embedding_model,
embedding_function, embedding_function,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment