Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ def construct_index(directory_path):
|
|
24 |
temperature = 0.1
|
25 |
|
26 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
27 |
-
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=temperature, model_name="gpt-3.5-turbo-
|
28 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
29 |
#index = GPTVectorStoreIndex(documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper)
|
30 |
index = GPTVectorStoreIndex.from_documents(documents, urls=[
|
@@ -69,7 +69,7 @@ def chatbotGPT(input):
|
|
69 |
if input:
|
70 |
messages.append({"role": "user", "content": input})
|
71 |
chat = openai.ChatCompletion.create(
|
72 |
-
model="gpt-3.5-turbo", messages=messages
|
73 |
)
|
74 |
reply = chat.choices[0].message.content
|
75 |
messages.append({"role": "assistant", "content": reply})
|
|
|
24 |
temperature = 0.1
|
25 |
|
26 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
27 |
+
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=temperature, model_name="gpt-3.5-turbo-1106", max_tokens=num_outputs))
|
28 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
29 |
#index = GPTVectorStoreIndex(documents, llm_predictor=llm_predictor, prompt_helper=prompt_helper)
|
30 |
index = GPTVectorStoreIndex.from_documents(documents, urls=[
|
|
|
69 |
if input:
|
70 |
messages.append({"role": "user", "content": input})
|
71 |
chat = openai.ChatCompletion.create(
|
72 |
+
model="gpt-3.5-turbo-1106", messages=messages
|
73 |
)
|
74 |
reply = chat.choices[0].message.content
|
75 |
messages.append({"role": "assistant", "content": reply})
|