Spaces:
Running
Running
Upload 9 files
Browse fileslangchain import issues
- app.py +1 -2
- get_keywords.py +1 -1
- requirements.txt +5 -5
- rerank.py +2 -5
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
-
|
2 |
-
from langchain_core.messages import AIMessage, HumanMessage
|
3 |
import openai
|
4 |
import gradio as gr
|
5 |
from full_chain import get_response
|
|
|
1 |
+
|
|
|
2 |
import openai
|
3 |
import gradio as gr
|
4 |
from full_chain import get_response
|
get_keywords.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from
|
2 |
from langchain_core.messages import (
|
3 |
HumanMessage,
|
4 |
SystemMessage
|
|
|
1 |
+
from langchain_openai import ChatOpenAI
|
2 |
from langchain_core.messages import (
|
3 |
HumanMessage,
|
4 |
SystemMessage
|
requirements.txt
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
gradio==4.25.0
|
2 |
-
langchain
|
3 |
-
langchain-core==0.1.
|
4 |
-
langchain-openai==0.
|
5 |
nltk==3.8.1
|
6 |
openai==1.16.2
|
7 |
pandas==2.2.1
|
8 |
pysolr==3.9.0
|
9 |
-
|
10 |
sentence-transformers==2.2.2
|
11 |
tiktoken==0.5.2
|
12 |
torch==2.1.2
|
13 |
huggingface-hub==0.20.2
|
14 |
python-dotenv==1.0.1
|
15 |
-
docarray==0.40.0
|
|
|
1 |
gradio==4.25.0
|
2 |
+
langchain==0.1.14
|
3 |
+
langchain-core==0.1.40
|
4 |
+
langchain-openai==0.1.1
|
5 |
nltk==3.8.1
|
6 |
openai==1.16.2
|
7 |
pandas==2.2.1
|
8 |
pysolr==3.9.0
|
9 |
+
rake-nltk==1.0.6
|
10 |
sentence-transformers==2.2.2
|
11 |
tiktoken==0.5.2
|
12 |
torch==2.1.2
|
13 |
huggingface-hub==0.20.2
|
14 |
python-dotenv==1.0.1
|
15 |
+
docarray==0.40.0
|
rerank.py
CHANGED
@@ -1,12 +1,9 @@
|
|
1 |
# reranks the top articles from a given csv file
|
2 |
from langchain_openai import ChatOpenAI
|
3 |
-
from
|
4 |
from langchain_community.document_loaders.csv_loader import CSVLoader
|
5 |
-
|
6 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
7 |
-
from
|
8 |
-
from sentence_transformers import CrossEncoder, util
|
9 |
-
from langchain.chains.qa_with_sources.retrieval import RetrievalQAWithSourcesChain
|
10 |
import pandas as pd
|
11 |
import time
|
12 |
|
|
|
1 |
# reranks the top articles from a given csv file
|
2 |
from langchain_openai import ChatOpenAI
|
3 |
+
from langchain.chains import RetrievalQA
|
4 |
from langchain_community.document_loaders.csv_loader import CSVLoader
|
|
|
5 |
from langchain_community.vectorstores import DocArrayInMemorySearch
|
6 |
+
from sentence_transformers import CrossEncoder
|
|
|
|
|
7 |
import pandas as pd
|
8 |
import time
|
9 |
|