Spaces:
Paused
Paused
dtrejopizzo
commited on
Commit
·
880e5a0
1
Parent(s):
e282c2e
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def construct_index(directory_path):
|
|
16 |
# create a prompt helper
|
17 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
18 |
# initialize the predictor with a fine-tuned model
|
19 |
-
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.9, model_name="gpt-
|
20 |
# load documents from the specified directory
|
21 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
22 |
# construct the index
|
@@ -25,11 +25,6 @@ def construct_index(directory_path):
|
|
25 |
index.storage_context.persist(persist_dir="index.json")
|
26 |
return index
|
27 |
|
28 |
-
|
29 |
-
def chatbot(input_text):
|
30 |
-
response = query_engine.query(input_text)
|
31 |
-
return response.response
|
32 |
-
|
33 |
def chatbot(input_text):
|
34 |
# load the index from disk
|
35 |
query_engine = index.as_query_engine()
|
|
|
16 |
# create a prompt helper
|
17 |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)
|
18 |
# initialize the predictor with a fine-tuned model
|
19 |
+
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.9, model_name="gpt-4", max_tokens=num_outputs))
|
20 |
# load documents from the specified directory
|
21 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
22 |
# construct the index
|
|
|
25 |
index.storage_context.persist(persist_dir="index.json")
|
26 |
return index
|
27 |
|
|
|
|
|
|
|
|
|
|
|
28 |
def chatbot(input_text):
|
29 |
# load the index from disk
|
30 |
query_engine = index.as_query_engine()
|