Chia Woon Yap
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,9 +18,9 @@ import uuid # For generating unique filenames
|
|
| 18 |
# Updated imports to address LangChain deprecation warnings:
|
| 19 |
from langchain_groq import ChatGroq
|
| 20 |
#from langchain.schema import HumanMessage
|
|
|
|
| 21 |
|
| 22 |
-
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
| 23 |
-
|
| 24 |
try:
|
| 25 |
# For newer versions
|
| 26 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
@@ -30,7 +30,9 @@ except ImportError:
|
|
| 30 |
|
| 31 |
from langchain_community.vectorstores import Chroma
|
| 32 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Importing chardet (make sure to add chardet to your requirements.txt)
|
| 36 |
import chardet
|
|
|
|
| 18 |
# Updated imports to address LangChain deprecation warnings:
|
| 19 |
from langchain_groq import ChatGroq
|
| 20 |
#from langchain.schema import HumanMessage
|
| 21 |
+
from langchain_core.messages import HumanMessage
|
| 22 |
|
| 23 |
+
#from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
|
|
| 24 |
try:
|
| 25 |
# For newer versions
|
| 26 |
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
|
|
|
| 30 |
|
| 31 |
from langchain_community.vectorstores import Chroma
|
| 32 |
from langchain_community.embeddings import HuggingFaceEmbeddings
|
| 33 |
+
|
| 34 |
+
#from langchain.docstore.document import Document
|
| 35 |
+
from langchain_core.documents import Document
|
| 36 |
|
| 37 |
# Importing chardet (make sure to add chardet to your requirements.txt)
|
| 38 |
import chardet
|