File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments