Dus Tran commited on
Commit
0bbf4ee
·
1 Parent(s): 3f20a80

feat(rag): use bkai huggingface model universally

Browse files
VectorDB/collection/chung/storage.sqlite CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c1d8a04276ee97871976635bc7d339d32dfd5d4df556206c6f64f1a8bc4e189c
3
  size 12288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a739a75f8f386f03dd51e049c885c112529bab469553c5c04a1218e645e6bb08
3
  size 12288
VectorDB/collection/doanh_nghiep/storage.sqlite CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c1d8a04276ee97871976635bc7d339d32dfd5d4df556206c6f64f1a8bc4e189c
3
  size 12288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a739a75f8f386f03dd51e049c885c112529bab469553c5c04a1218e645e6bb08
3
  size 12288
VectorDB/collection/ky_thuat/storage.sqlite CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c1d8a04276ee97871976635bc7d339d32dfd5d4df556206c6f64f1a8bc4e189c
3
  size 12288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a739a75f8f386f03dd51e049c885c112529bab469553c5c04a1218e645e6bb08
3
  size 12288
VectorDB/collection/rag_input/storage.sqlite CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:d6538d80613bbad3956f236f0cd4c20dc8b865b0908b93c61c47dea13149f20a
3
  size 10801152
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:834a445c736b7125c23b5475a0b81ad15cc1073adedf578d353d88eb43c18317
3
  size 10801152
app/core/config.py CHANGED
@@ -26,8 +26,7 @@ LLM_MODEL_NAME = "llama-3.3-70b-versatile"
26
  RERANK_MODEL_NAME = "cross-encoder/ms-marco-MiniLM-L-6-v2"
27
 
28
  def get_embeddings():
29
- if IS_RENDER:
30
- return GoogleGenerativeAIEmbeddings(model="models/gemini-embedding-2", output_dimensionality=768)
31
  return HuggingFaceEmbeddings(model_name=EMBED_MODEL_NAME)
32
 
33
 
 
26
  RERANK_MODEL_NAME = "cross-encoder/ms-marco-MiniLM-L-6-v2"
27
 
28
  def get_embeddings():
29
+ from langchain_huggingface import HuggingFaceEmbeddings
 
30
  return HuggingFaceEmbeddings(model_name=EMBED_MODEL_NAME)
31
 
32
 
app/service/ingest.py CHANGED
@@ -6,7 +6,7 @@ from langchain_community.document_loaders import (
6
  CSVLoader,
7
  UnstructuredMarkdownLoader
8
  )
9
- from langchain_experimental.text_splitter import SemanticChunker
10
  from langchain_qdrant import QdrantVectorStore
11
  from qdrant_client import QdrantClient
12
  from qdrant_client.http import models
@@ -46,7 +46,8 @@ def load_document():
46
  if not langchain_docs:
47
  return None
48
 
49
- # 2. Chunking
 
50
  embeddings = get_embeddings()
51
  semantic_chunker = SemanticChunker(
52
  embeddings,
 
6
  CSVLoader,
7
  UnstructuredMarkdownLoader
8
  )
9
+
10
  from langchain_qdrant import QdrantVectorStore
11
  from qdrant_client import QdrantClient
12
  from qdrant_client.http import models
 
46
  if not langchain_docs:
47
  return None
48
 
49
+ from langchain_experimental.text_splitter import SemanticChunker
50
+
51
  embeddings = get_embeddings()
52
  semantic_chunker = SemanticChunker(
53
  embeddings,