sanjeevl10 commited on
Commit
fd2d856
1 Parent(s): 911e021

added openai call

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -5,9 +5,8 @@ from operator import itemgetter
5
  from langchain_huggingface import HuggingFaceEndpoint
6
  from langchain_text_splitters import RecursiveCharacterTextSplitter
7
  from langchain.document_loaders import PyMuPDFLoader
8
- from langchain_huggingface import HuggingFaceEndpointEmbeddings
9
  from langchain_core.prompts import PromptTemplate
10
- from langchain_openai.embeddings import OpenAI
11
  from langchain.schema.runnable.config import RunnableConfig
12
  from langchain_community.vectorstores import Qdrant
13
 
@@ -49,7 +48,7 @@ text_splitter = RecursiveCharacterTextSplitter(
49
  split_documents = text_splitter.split_documents(documents)
50
 
51
  ### 3. LOAD open ai EMBEDDINGS
52
- embeddings = OpenAI(OPENAPI_API_KEY=OPENAPI_KEY,model="text-embedding-ada-002")
53
 
54
  #Initialize the Vector Store
55
  if os.path.exists("./vectorstore"):
 
5
  from langchain_huggingface import HuggingFaceEndpoint
6
  from langchain_text_splitters import RecursiveCharacterTextSplitter
7
  from langchain.document_loaders import PyMuPDFLoader
 
8
  from langchain_core.prompts import PromptTemplate
9
+ from langchain_community.embeddings.openai import OpenAIEmbeddings
10
  from langchain.schema.runnable.config import RunnableConfig
11
  from langchain_community.vectorstores import Qdrant
12
 
 
48
  split_documents = text_splitter.split_documents(documents)
49
 
50
  ### 3. LOAD open ai EMBEDDINGS
51
+ embeddings = OpenAIEmbeddings(OPENAPI_API_KEY=OPENAPI_KEY,model="text-embedding-ada-002")
52
 
53
  #Initialize the Vector Store
54
  if os.path.exists("./vectorstore"):