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
|
- .html
|
||||||
- .md
|
- .md
|
||||||
- .pdf
|
- .pdf
|
||||||
- links (Note that only SSL-secured websites are supported)
|
- links to websites
|
||||||
|
|
||||||
## How the Rag is working in the GUI:
|
## How the Rag is working in the GUI:
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,4 @@ langchain_community
|
||||||
langchain
|
langchain
|
||||||
pathlib
|
pathlib
|
||||||
unstructured
|
unstructured
|
||||||
markdown
|
markdown
|
||||||
requests
|
|
|
@ -6,7 +6,6 @@ from langchain_community.embeddings import OllamaEmbeddings
|
||||||
from langchain_community.vectorstores import Chroma
|
from langchain_community.vectorstores import Chroma
|
||||||
from langchain_community.chat_models import ChatOllama
|
from langchain_community.chat_models import ChatOllama
|
||||||
from langchain.chains import RetrievalQA
|
from langchain.chains import RetrievalQA
|
||||||
import requests
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,12 +40,9 @@ class Rag:
|
||||||
def get_file(self, file_path):
|
def get_file(self, file_path):
|
||||||
# Check if the file path starts with 'https://'
|
# Check if the file path starts with 'https://'
|
||||||
if file_path.startswith('https://'):
|
if file_path.startswith('https://'):
|
||||||
try:
|
loader = WebBaseLoader(file_path)
|
||||||
loader = WebBaseLoader(file_path)
|
data = loader.load()
|
||||||
data = loader.load()
|
if data is None:
|
||||||
if data is None:
|
|
||||||
return False
|
|
||||||
except requests.exceptions.SSLError:
|
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
file_type = file_path.split(".")[-1]
|
file_type = file_path.split(".")[-1]
|
||||||
|
@ -65,7 +61,8 @@ class Rag:
|
||||||
loader = PyPDFLoader(file_path=file_path)
|
loader = PyPDFLoader(file_path=file_path)
|
||||||
data = loader.load_and_split()
|
data = loader.load_and_split()
|
||||||
case _:
|
case _:
|
||||||
return False
|
loader = WebBaseLoader(file_path)
|
||||||
|
data = loader.load()
|
||||||
except OSError:
|
except OSError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue