Skip to content

Commit 064d406

Browse files
Fix too large payload error on function apps by reducing rate of processing (#162)
1 parent 2c6a3db commit 064d406

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

deploy_ai_search_indexes/src/deploy_ai_search_indexes/ai_search.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def get_mark_up_cleaner_skill(self, chunk_by_page: False) -> WebApiSkill:
212212
batch_size = 2
213213
degree_of_parallelism = 2
214214
else:
215-
batch_size = 16
215+
batch_size = 4
216216
degree_of_parallelism = 16
217217

218218
if chunk_by_page:
@@ -273,10 +273,10 @@ def get_mark_up_cleaner_skill(self, chunk_by_page: False) -> WebApiSkill:
273273

274274
def get_semantic_chunker_skill(
275275
self,
276-
num_surrounding_sentences: int = 1,
276+
num_surrounding_sentences: int = 2,
277277
similarity_threshold: float = 0.8,
278-
max_chunk_tokens: int = 200,
279-
min_chunk_tokens: int = 50,
278+
max_chunk_tokens: int = 500,
279+
min_chunk_tokens: int = 150,
280280
) -> SplitSkill:
281281
"""Get the skill for text split.
282282
@@ -296,7 +296,7 @@ def get_semantic_chunker_skill(
296296
batch_size = 2
297297
degree_of_parallelism = 2
298298
else:
299-
batch_size = 16
299+
batch_size = 8
300300
degree_of_parallelism = 16
301301

302302
semantic_text_chunker_skill_inputs = [

deploy_ai_search_indexes/src/deploy_ai_search_indexes/image_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ def get_indexer(self) -> SearchIndexer:
301301
# Only place on schedule if it is not a test deployment
302302
if self.test:
303303
schedule = None
304-
batch_size = 4
304+
batch_size = 1
305305
else:
306306
schedule = {"interval": "PT15M"}
307-
batch_size = 16
307+
batch_size = 2
308308

309309
if self.environment.use_private_endpoint:
310310
execution_environment = IndexerExecutionEnvironment.PRIVATE

image_processing/src/image_processing/semantic_text_chunker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
class SemanticTextChunker:
1313
def __init__(
1414
self,
15-
num_surrounding_sentences: int = 1,
15+
num_surrounding_sentences: int = 2,
1616
similarity_threshold: float = 0.8,
17-
max_chunk_tokens: int = 200,
18-
min_chunk_tokens: int = 50,
17+
max_chunk_tokens: int = 500,
18+
min_chunk_tokens: int = 150,
1919
):
2020
self.num_surrounding_sentences = num_surrounding_sentences
2121
self.similarity_threshold = similarity_threshold

0 commit comments

Comments
 (0)