Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
from llama_index import
|
| 3 |
from llama_index.llms.huggingface import HuggingFaceInferenceAPI
|
| 4 |
-
from dotenv import load_dotenv
|
| 5 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
|
|
|
| 6 |
from llama_index.core import Settings
|
| 7 |
import os
|
| 8 |
import base64
|
|
@@ -57,7 +57,7 @@ def data_ingestion():
|
|
| 57 |
|
| 58 |
def handle_query(query):
|
| 59 |
storage_context = StorageContext.from_defaults(persist_dir=PERSIST_DIR)
|
| 60 |
-
index =
|
| 61 |
|
| 62 |
results = index.search(query)
|
| 63 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, StorageContext
|
| 3 |
from llama_index.llms.huggingface import HuggingFaceInferenceAPI
|
|
|
|
| 4 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
| 5 |
+
from dotenv import load_dotenv
|
| 6 |
from llama_index.core import Settings
|
| 7 |
import os
|
| 8 |
import base64
|
|
|
|
| 57 |
|
| 58 |
def handle_query(query):
|
| 59 |
storage_context = StorageContext.from_defaults(persist_dir=PERSIST_DIR)
|
| 60 |
+
index = VectorStoreIndex.from_storage_context(storage_context)
|
| 61 |
|
| 62 |
results = index.search(query)
|
| 63 |
|