Compare commits
No commits in common. "87727b3d1ea62610f3848eb752c335b0cfaa8bef" and "243afd2f0145b026d45eaf8d453b40c8505bc6ca" have entirely different histories.
87727b3d1e
...
243afd2f01
|
@ -81,7 +81,7 @@ You can provide the following files / links as context to Ollama:
|
|||
- .html
|
||||
- .md
|
||||
- .pdf
|
||||
- links (Note that only SSL-secured websites are supported)
|
||||
- links to websites
|
||||
|
||||
## How the Rag is working in the GUI:
|
||||
|
||||
|
|
|
@ -6,5 +6,4 @@ langchain_community
|
|||
langchain
|
||||
pathlib
|
||||
unstructured
|
||||
markdown
|
||||
requests
|
||||
markdown
|
|
@ -6,7 +6,6 @@ from langchain_community.embeddings import OllamaEmbeddings
|
|||
from langchain_community.vectorstores import Chroma
|
||||
from langchain_community.chat_models import ChatOllama
|
||||
from langchain.chains import RetrievalQA
|
||||
import requests
|
||||
|
||||
|
||||
|
||||
|
@ -41,12 +40,9 @@ class Rag:
|
|||
def get_file(self, file_path):
|
||||
# Check if the file path starts with 'https://'
|
||||
if file_path.startswith('https://'):
|
||||
try:
|
||||
loader = WebBaseLoader(file_path)
|
||||
data = loader.load()
|
||||
if data is None:
|
||||
return False
|
||||
except requests.exceptions.SSLError:
|
||||
loader = WebBaseLoader(file_path)
|
||||
data = loader.load()
|
||||
if data is None:
|
||||
return False
|
||||
else:
|
||||
file_type = file_path.split(".")[-1]
|
||||
|
@ -65,7 +61,8 @@ class Rag:
|
|||
loader = PyPDFLoader(file_path=file_path)
|
||||
data = loader.load_and_split()
|
||||
case _:
|
||||
return False
|
||||
loader = WebBaseLoader(file_path)
|
||||
data = loader.load()
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
|
Loading…
Reference in New Issue