minh-4T commited on
Commit
c6458da
·
verified ·
1 Parent(s): 8723e94

Update core/models.py

Browse files
Files changed (1) hide show
  1. core/models.py +4 -2
core/models.py CHANGED
@@ -1,12 +1,14 @@
1
  from langchain_huggingface import HuggingFaceEmbeddings
2
- from .config import EMBED_MODEL
 
3
 
4
- # Model này sẽ chạy trên CPU của Hugging Face
5
  embeddings = HuggingFaceEmbeddings(
6
  model_name=EMBED_MODEL,
7
  model_kwargs={'device': 'cpu'},
8
  encode_kwargs={'normalize_embeddings': True}
9
  )
 
10
  cross_encoder = CrossEncoder(CROSS_ENCODER_MODEL, device='cpu')
11
 
12
  llm = None
 
1
  from langchain_huggingface import HuggingFaceEmbeddings
2
+ from sentence_transformers import CrossEncoder
3
+ from .config import EMBED_MODEL, CROSS_ENCODER_MODEL
4
 
5
+ # Khởi tạo Embedding model - Chạy trên CPU của Hugging Face
6
  embeddings = HuggingFaceEmbeddings(
7
  model_name=EMBED_MODEL,
8
  model_kwargs={'device': 'cpu'},
9
  encode_kwargs={'normalize_embeddings': True}
10
  )
11
+
12
  cross_encoder = CrossEncoder(CROSS_ENCODER_MODEL, device='cpu')
13
 
14
  llm = None