Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -77,12 +77,10 @@ def ask_ai(question,openai_api_key):
|
|
77 |
construct_index("data")
|
78 |
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
#response = index.query(question, response_mode="compact")
|
85 |
-
#return response.response
|
86 |
|
87 |
|
88 |
api_key = gr.inputs.Textbox(label="Paste OPENAI API Key (Or left it blank to use default api)")
|
|
|
77 |
construct_index("data")
|
78 |
|
79 |
|
80 |
+
|
81 |
+
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
82 |
+
response = index.query(question, response_mode="compact")
|
83 |
+
return response.response
|
|
|
|
|
84 |
|
85 |
|
86 |
api_key = gr.inputs.Textbox(label="Paste OPENAI API Key (Or left it blank to use default api)")
|