Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,8 +19,12 @@ def construct_index(directory_path):
|
|
19 |
llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.5, model_name="gpt-3.5-turbo", max_tokens=num_outputs))
|
20 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
21 |
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
26 |
|
|
|
19 |
llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.5, model_name="gpt-3.5-turbo", max_tokens=num_outputs))
|
20 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
21 |
|
22 |
+
|
23 |
+
def ask_ai(question,api):
|
24 |
+
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
25 |
+
response = index.query(question, response_mode="compact")
|
26 |
+
return response.response
|
27 |
+
|
28 |
|
29 |
|
30 |
|