Skip to content

Commit d8b898c

Browse files
fix
1 parent b65dd6d commit d8b898c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

WDoc/WDoc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def query_task(self, query: Optional[str]) -> dict:
11861186
failed = True
11871187
red(
11881188
f"Failed to get query_eval_model parameters information bypassing openrouter: '{err}'")
1189-
if self.modelbackend != "openrouter" or failed:
1189+
if self.query_eval_modelbackend != "openrouter" or failed:
11901190
self.eval_llm_params = litellm.get_supported_openai_params(
11911191
model=self.query_eval_modelname,
11921192
custom_llm_provider=self.query_eval_modelbackend,
@@ -1539,10 +1539,10 @@ def retrieve_documents(inputs):
15391539
if len(batches[-1]) < 2:
15401540
# make sure there's at least 2 per batch
15411541
batches[-1].append(ia)
1542-
elif get_tkn_length(batches[-1]) >= batch_tkn_size:
1542+
elif sum([get_tkn_length(b) for b in batches[-1]]) >= batch_tkn_size:
15431543
# cap batch size to the max tkn size
15441544
batches.append([ia])
1545-
elif get_tkn_length(batches[-1]) < batch_tkn_size:
1545+
else:
15461546
batches[-1].append(ia)
15471547
batch_args = [
15481548
{

0 commit comments

Comments
 (0)