Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -4,7 +4,7 @@ import streamlit as st
|
|
4 |
import anthropic
|
5 |
|
6 |
# from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
|
7 |
-
from langchain_community.embeddings import
|
8 |
from langchain_community.vectorstores import SupabaseVectorStore
|
9 |
from langchain_community.llms import HuggingFaceEndpoint
|
10 |
from langchain_community.vectorstores import SupabaseVectorStore
|
@@ -26,12 +26,10 @@ username = st.secrets.username
|
|
26 |
supabase: Client = create_client(supabase_url, supabase_key)
|
27 |
logger = get_logger(__name__)
|
28 |
|
29 |
-
|
30 |
-
|
31 |
model_name = "BAAI/bge-large-en-v1.5"
|
32 |
model_kwargs = {'device': 'cpu'}
|
33 |
encode_kwargs = {'normalize_embeddings': True}
|
34 |
-
embeddings =
|
35 |
model_name=model_name,
|
36 |
model_kwargs=model_kwargs,
|
37 |
encode_kwargs=encode_kwargs
|
|
|
4 |
import anthropic
|
5 |
|
6 |
# from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
|
7 |
+
from langchain_community.embeddings import HuggingFaceBgeEmbeddings
|
8 |
from langchain_community.vectorstores import SupabaseVectorStore
|
9 |
from langchain_community.llms import HuggingFaceEndpoint
|
10 |
from langchain_community.vectorstores import SupabaseVectorStore
|
|
|
26 |
supabase: Client = create_client(supabase_url, supabase_key)
|
27 |
logger = get_logger(__name__)
|
28 |
|
|
|
|
|
29 |
model_name = "BAAI/bge-large-en-v1.5"
|
30 |
model_kwargs = {'device': 'cpu'}
|
31 |
encode_kwargs = {'normalize_embeddings': True}
|
32 |
+
embeddings = HuggingFaceBgeEmbeddings(
|
33 |
model_name=model_name,
|
34 |
model_kwargs=model_kwargs,
|
35 |
encode_kwargs=encode_kwargs
|