Spaces:
Runtime error
Runtime error
freQuensy23
commited on
Commit
•
6a3c13a
1
Parent(s):
07fa0f4
[FIX] deprication warnings
Browse files
app.py
CHANGED
@@ -1,12 +1,22 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from langchain.text_splitter import SentenceTransformersTokenTextSplitter
|
3 |
-
from
|
4 |
-
from
|
5 |
from langchain_community.vectorstores.utils import DistanceStrategy
|
6 |
-
from
|
7 |
import gradio as gr
|
8 |
import re
|
9 |
|
|
|
|
|
10 |
model = "msmarco-distilbert-base-tas-b"
|
11 |
embeddings = SentenceTransformerEmbeddings(model_name=model)
|
12 |
prev_files = None
|
|
|
1 |
+
import warnings
|
2 |
+
|
3 |
+
from langchain_core._api import LangChainDeprecationWarning
|
4 |
+
|
5 |
+
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
6 |
+
warnings.filterwarnings("ignore", category=UserWarning)
|
7 |
+
warnings.filterwarnings("ignore", category=LangChainDeprecationWarning)
|
8 |
+
|
9 |
+
from langchain_community.document_loaders import PyMuPDFLoader
|
10 |
from langchain.text_splitter import SentenceTransformersTokenTextSplitter
|
11 |
+
from langchain_community.embeddings import SentenceTransformerEmbeddings
|
12 |
+
from langchain_community.retrievers import BM25Retriever
|
13 |
from langchain_community.vectorstores.utils import DistanceStrategy
|
14 |
+
from langchain_community.vectorstores import FAISS
|
15 |
import gradio as gr
|
16 |
import re
|
17 |
|
18 |
+
print('All imports are successful')
|
19 |
+
|
20 |
model = "msmarco-distilbert-base-tas-b"
|
21 |
embeddings = SentenceTransformerEmbeddings(model_name=model)
|
22 |
prev_files = None
|