Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,8 @@ 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": False
|
| 84 |
} # set True to compute cosine similarity
|
|
@@ -161,10 +162,11 @@ def get_response(message, history=[]):
|
|
| 161 |
@app.on_event("startup")
|
| 162 |
async def startup():
|
| 163 |
print("donee.... ")
|
| 164 |
-
domain_url = 'https://ki-fusion-labs.de'
|
| 165 |
links = get_all_links_from_domain(domain_url)
|
| 166 |
print(links)
|
| 167 |
retriever_chain = index_urls_in_rag(links)
|
|
|
|
| 168 |
retriever_chain.invoke("Was ist bofrost*")
|
| 169 |
get_response("Was kosten Schoko Osterhasen?")
|
| 170 |
|
|
|
|
| 78 |
# Function to index URLs in RAG
|
| 79 |
def index_urls_in_rag(urls=[]):
|
| 80 |
# Load the RAG model
|
| 81 |
+
rag_model = "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2"
|
| 82 |
+
#rag_model = "intfloat/e5-mistral-7b-instruct"
|
| 83 |
encode_kwargs = {
|
| 84 |
"normalize_embeddings": False
|
| 85 |
} # set True to compute cosine similarity
|
|
|
|
| 162 |
@app.on_event("startup")
|
| 163 |
async def startup():
|
| 164 |
print("donee.... ")
|
| 165 |
+
domain_url = 'https://ki-fusion-labs.de/blog.html'
|
| 166 |
links = get_all_links_from_domain(domain_url)
|
| 167 |
print(links)
|
| 168 |
retriever_chain = index_urls_in_rag(links)
|
| 169 |
+
|
| 170 |
retriever_chain.invoke("Was ist bofrost*")
|
| 171 |
get_response("Was kosten Schoko Osterhasen?")
|
| 172 |
|