Spaces:
Runtime error
Runtime error
Commit ·
21a797b
1
Parent(s): 4d08b87
Update app.py
Browse files- Modification chunk parameters
app.py
CHANGED
|
@@ -41,19 +41,22 @@ def construct_index(doc):
|
|
| 41 |
|
| 42 |
## Define the prompt helper
|
| 43 |
# Set maximum input size
|
| 44 |
-
max_input_size =
|
| 45 |
|
| 46 |
# Set number of output tokens
|
| 47 |
-
num_output =
|
| 48 |
|
| 49 |
#Set the chunk size limit
|
| 50 |
chunk_size_limit = 600 # About 450 words ~ 1 page
|
| 51 |
|
|
|
|
|
|
|
|
|
|
| 52 |
# Set chunk overlap ratio
|
| 53 |
-
chunk_overlap_ratio = 0.
|
| 54 |
|
| 55 |
# Define prompt helper
|
| 56 |
-
prompt_helper = PromptHelper(max_input_size, num_output, chunk_size_limit, chunk_overlap_ratio)
|
| 57 |
|
| 58 |
## Define the LLM predictor
|
| 59 |
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.4, model_name="gpt-4-32k", max_tokens=num_output))
|
|
|
|
| 41 |
|
| 42 |
## Define the prompt helper
|
| 43 |
# Set maximum input size
|
| 44 |
+
max_input_size = 1800
|
| 45 |
|
| 46 |
# Set number of output tokens
|
| 47 |
+
num_output = 400 # About 300 words
|
| 48 |
|
| 49 |
#Set the chunk size limit
|
| 50 |
chunk_size_limit = 600 # About 450 words ~ 1 page
|
| 51 |
|
| 52 |
+
# Set maximum chunk overlap
|
| 53 |
+
max_chunk_overlap = 1
|
| 54 |
+
|
| 55 |
# Set chunk overlap ratio
|
| 56 |
+
chunk_overlap_ratio = 0.5
|
| 57 |
|
| 58 |
# Define prompt helper
|
| 59 |
+
prompt_helper = PromptHelper(max_input_size, num_output, max_chunk_overlap, chunk_size_limit, chunk_overlap_ratio)
|
| 60 |
|
| 61 |
## Define the LLM predictor
|
| 62 |
llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.4, model_name="gpt-4-32k", max_tokens=num_output))
|