Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,25 +19,8 @@ from langchain import OpenAI, LLMChain
|
|
19 |
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader
|
20 |
|
21 |
|
22 |
-
fs = s3fs.S3FileSystem(
|
23 |
-
key="AKIAZOU6TJIYU64BCGHE",
|
24 |
-
secret="RZxYW0WAs53lwdwCXkOo3qCiK7kk5HT+v6deXL7h"
|
25 |
-
)
|
26 |
-
|
27 |
-
# download the index file from S3
|
28 |
-
with fs.open('notesinendocrinology/index.json', 'rb') as f:
|
29 |
-
index_data = f.read()
|
30 |
-
|
31 |
-
import json
|
32 |
-
|
33 |
-
# Decode the bytes to a string using UTF-8 encoding
|
34 |
-
index_str = index_data.decode('utf-8')
|
35 |
-
|
36 |
-
# Load the JSON data into a dictionary
|
37 |
-
index_dict = json.loads(index_str)
|
38 |
|
39 |
-
|
40 |
-
index = GPTSimpleVectorIndex.load_from_string(index_str)
|
41 |
|
42 |
|
43 |
def querying_db(query: str):
|
|
|
19 |
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader
|
20 |
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
+
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
|
|
24 |
|
25 |
|
26 |
def querying_db(query: str):
|