sabazo commited on
Commit
bd5e335
1 Parent(s): 0149098

added chroma_db download from S3

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
-
3
  from langchain.document_loaders import WebBaseLoader
4
 
5
  from langchain.text_splitter import RecursiveCharacterTextSplitter
@@ -20,6 +20,9 @@ from langchain.prompts import ChatPromptTemplate
20
  #web_links = ["https://www.databricks.com/","https://help.databricks.com","https://docs.databricks.com","https://kb.databricks.com/","http://docs.databricks.com/getting-started/index.html","http://docs.databricks.com/introduction/index.html","http://docs.databricks.com/getting-started/tutorials/index.html","http://docs.databricks.com/machine-learning/index.html","http://docs.databricks.com/sql/index.html"]
21
  #loader = WebBaseLoader(web_links)
22
  #documents = loader.load()
 
 
 
23
 
24
  db = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
25
  db.get()
 
1
  import gradio as gr
2
+ import boto3
3
  from langchain.document_loaders import WebBaseLoader
4
 
5
  from langchain.text_splitter import RecursiveCharacterTextSplitter
 
20
  #web_links = ["https://www.databricks.com/","https://help.databricks.com","https://docs.databricks.com","https://kb.databricks.com/","http://docs.databricks.com/getting-started/index.html","http://docs.databricks.com/introduction/index.html","http://docs.databricks.com/getting-started/tutorials/index.html","http://docs.databricks.com/machine-learning/index.html","http://docs.databricks.com/sql/index.html"]
21
  #loader = WebBaseLoader(web_links)
22
  #documents = loader.load()
23
+
24
+ s3 = boto3.client('s3')
25
+ s3.download_file('rad-rag-demos', 'vectorstores/chroma.sqlite3', './chroma_db/chroma.sqlite3')
26
 
27
  db = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
28
  db.get()