Spaces:
Sleeping
Sleeping
Commit
•
548e573
1
Parent(s):
023480d
Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,11 @@ if "OPENAI_API_KEY" in os.environ:
|
|
32 |
dotenv.load_dotenv()
|
33 |
chat = ChatOpenAI(model="gpt-3.5-turbo-1106", temperature=0.2)
|
34 |
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
37 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
38 |
all_splits = text_splitter.split_documents(data)
|
39 |
vectorstore = Chroma.from_documents(documents=all_splits, embedding=OpenAIEmbeddings())
|
|
|
32 |
dotenv.load_dotenv()
|
33 |
chat = ChatOpenAI(model="gpt-3.5-turbo-1106", temperature=0.2)
|
34 |
|
35 |
+
loader1 = WebBaseLoader("https://www.tbankltd.com/")
|
36 |
+
loader2 = PyPDFLoader("path/to/your/file.pdf")
|
37 |
+
data1 = loader1.load()
|
38 |
+
data2 = loader2.load()
|
39 |
+
data= data1 + data2
|
40 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
41 |
all_splits = text_splitter.split_documents(data)
|
42 |
vectorstore = Chroma.from_documents(documents=all_splits, embedding=OpenAIEmbeddings())
|