Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ load_index_from_storage,
|
|
17 |
set_global_service_context,
|
18 |
)
|
19 |
#from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings
|
20 |
-
from langchain_community.embeddings import HuggingFaceInstructEmbeddings
|
21 |
#from llama_index.embeddings.huggingface import HuggingFaceInstructEmbeddings
|
22 |
from g4f import Provider, models
|
23 |
|
@@ -49,7 +49,7 @@ embed_model = HuggingFaceInstructEmbeddings(
|
|
49 |
model_name = "hkunlp/instructor-xl"
|
50 |
model_kwargs = {'device': 'cpu'}
|
51 |
encode_kwargs = {'normalize_embeddings': True}
|
52 |
-
embed_model =
|
53 |
model_name=model_name,
|
54 |
model_kwargs=model_kwargs,
|
55 |
encode_kwargs=encode_kwargs
|
|
|
17 |
set_global_service_context,
|
18 |
)
|
19 |
#from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings
|
20 |
+
#from langchain_community.embeddings import HuggingFaceInstructEmbeddings
|
21 |
#from llama_index.embeddings.huggingface import HuggingFaceInstructEmbeddings
|
22 |
from g4f import Provider, models
|
23 |
|
|
|
49 |
model_name = "hkunlp/instructor-xl"
|
50 |
model_kwargs = {'device': 'cpu'}
|
51 |
encode_kwargs = {'normalize_embeddings': True}
|
52 |
+
embed_model = InstructorEmbedding(
|
53 |
model_name=model_name,
|
54 |
model_kwargs=model_kwargs,
|
55 |
encode_kwargs=encode_kwargs
|