TEMELJNI commited on
Commit
052d6eb
·
1 Parent(s): d5f8bac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -16,11 +16,10 @@ def construct_index(directory_path):
16
 
17
  llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.7, model_name='text-davinci-003', max_tokens=num_outputs))
18
 
19
- documents = SimpleDirectoryReader(directory_path).load_data()
20
 
21
- index = GPTSimpleVectorIndex.from_documents(documents)
22
 
23
- index.save_to_disk('index.json')
24
 
25
  return index
26
 
@@ -34,5 +33,5 @@ iface = gr.Interface(fn=chatbot,
34
  outputs="text",
35
  title="Custom-trained AI Chatbot")
36
 
37
- index = construct_index("docs")
38
  iface.launch()
 
16
 
17
  llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.7, model_name='text-davinci-003', max_tokens=num_outputs))
18
 
19
+
20
 
21
+
22
 
 
23
 
24
  return index
25
 
 
33
  outputs="text",
34
  title="Custom-trained AI Chatbot")
35
 
36
+
37
  iface.launch()