Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,7 +67,7 @@ def get_links_from_page(url, visited_urls, all_links, base_domain):
|
|
67 |
print(f"Failed to retrieve content from {url}. Status code: {response.status_code}")
|
68 |
|
69 |
|
70 |
-
from langchain_community.embeddings import
|
71 |
from langchain.chains import RetrievalQA
|
72 |
|
73 |
from langchain.memory import ConversationBufferMemory
|
@@ -78,11 +78,11 @@ from langchain_community.document_transformers import BeautifulSoupTransformer
|
|
78 |
# Function to index URLs in RAG
|
79 |
def index_urls_in_rag(urls=[]):
|
80 |
# Load the RAG model
|
81 |
-
rag_model = "
|
82 |
encode_kwargs = {
|
83 |
-
"normalize_embeddings":
|
84 |
} # set True to compute cosine similarity
|
85 |
-
embeddings =
|
86 |
model_name=rag_model, encode_kwargs=encode_kwargs, model_kwargs={"device": "cpu"}
|
87 |
)
|
88 |
|
|
|
67 |
print(f"Failed to retrieve content from {url}. Status code: {response.status_code}")
|
68 |
|
69 |
|
70 |
+
from langchain_community.embeddings import HuggingFaceBEmbeddings
|
71 |
from langchain.chains import RetrievalQA
|
72 |
|
73 |
from langchain.memory import ConversationBufferMemory
|
|
|
78 |
# Function to index URLs in RAG
|
79 |
def index_urls_in_rag(urls=[]):
|
80 |
# Load the RAG model
|
81 |
+
rag_model = "intfloat/e5-mistral-7b-instruct"
|
82 |
encode_kwargs = {
|
83 |
+
"normalize_embeddings": False
|
84 |
} # set True to compute cosine similarity
|
85 |
+
embeddings = HuggingFaceEmbeddings(
|
86 |
model_name=rag_model, encode_kwargs=encode_kwargs, model_kwargs={"device": "cpu"}
|
87 |
)
|
88 |
|