Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
-
import
|
4 |
from llama_index import GPTSimpleVectorIndex
|
5 |
from langchain.agents import ZeroShotAgent, AgentExecutor
|
6 |
from langchain.agents import Tool
|
@@ -8,11 +8,12 @@ from langchain import OpenAI, LLMChain
|
|
8 |
|
9 |
os.environ['OPENAI_API_KEY'] = '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'
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
16 |
|
17 |
index = GPTSimpleVectorIndex.load_from_disk('comboindex.json')
|
18 |
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
+
import boto3
|
4 |
from llama_index import GPTSimpleVectorIndex
|
5 |
from langchain.agents import ZeroShotAgent, AgentExecutor
|
6 |
from langchain.agents import Tool
|
|
|
8 |
|
9 |
os.environ['OPENAI_API_KEY'] = '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'
|
10 |
|
11 |
+
s3 = boto3.resource('s3')
|
12 |
+
bucket_name = "notesinendocrinology"
|
13 |
+
bucket = s3.Bucket(bucket_name)
|
14 |
+
for obj in bucket.objects.filter(Prefix="comboindex.json"):
|
15 |
+
combo_index_path = obj.key
|
16 |
+
bucket.download_file(combo_index_path, "comboindex.json")
|
17 |
|
18 |
index = GPTSimpleVectorIndex.load_from_disk('comboindex.json')
|
19 |
|