fastx commited on
Commit
487d213
·
1 Parent(s): 9a7b485

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -77,12 +77,10 @@ def ask_ai(question,openai_api_key):
77
  construct_index("data")
78
 
79
 
80
- reply = chat.choices[0].message.content
81
- messages.append({"role": "assistant", "content": reply})
82
- return messages
83
- #index = GPTSimpleVectorIndex.load_from_disk('index.json')
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)")