Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from llama_index.core import set_global_service_context
|
|
11 |
|
12 |
import gradio as gr
|
13 |
|
14 |
-
DOC_PATH = '/data/pdf_esg'
|
15 |
INDEX_PATH = '/storage'
|
16 |
Settings.llm = Ollama(model="mistral")
|
17 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
|
@@ -29,7 +29,7 @@ def construct_index(doc_path=DOC_PATH, index_store=INDEX_PATH, use_cache=False):
|
|
29 |
storage_context = StorageContext.from_defaults(persist_dir=index_store)
|
30 |
index = load_index_from_storage(storage_context) # load index
|
31 |
else:
|
32 |
-
reader = SimpleDirectoryReader(input_dir='/data/pdf_esg')
|
33 |
documents = reader.load_data()
|
34 |
index = VectorStoreIndex.from_documents(documents)
|
35 |
index.storage_context.persist(index_store)
|
|
|
11 |
|
12 |
import gradio as gr
|
13 |
|
14 |
+
DOC_PATH = '/esg_chatbot/data/pdf_esg'
|
15 |
INDEX_PATH = '/storage'
|
16 |
Settings.llm = Ollama(model="mistral")
|
17 |
Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5")
|
|
|
29 |
storage_context = StorageContext.from_defaults(persist_dir=index_store)
|
30 |
index = load_index_from_storage(storage_context) # load index
|
31 |
else:
|
32 |
+
reader = SimpleDirectoryReader(input_dir='/esg_chatbot/data/pdf_esg')
|
33 |
documents = reader.load_data()
|
34 |
index = VectorStoreIndex.from_documents(documents)
|
35 |
index.storage_context.persist(index_store)
|