"examples/vscode:/vscode.git/clone" did not exist on "7ce89e979c45ab954fd49106668a5f465aacb08c"
Unverified Commit 8cffa29b authored by Baber Abbasi's avatar Baber Abbasi Committed by GitHub
Browse files

[hotfix] API: messages were created twice (#2174)

parent 0ce7734d
...@@ -107,7 +107,7 @@ class TemplateAPI(TemplateLM): ...@@ -107,7 +107,7 @@ class TemplateAPI(TemplateLM):
self.max_length = max_length self.max_length = max_length
if int(num_concurrent) <= 1: if int(num_concurrent) <= 1:
eval_logger.info( eval_logger.info(
"Concurrent requests are disabled. To enable concurrent requests, set `num_concurrent > 1`." "Concurrent requests are disabled. To enable concurrent requests, set `num_concurrent` > 1."
) )
self._concurrent = int(num_concurrent) self._concurrent = int(num_concurrent)
self.tokenizer_backend = tokenizer_backend self.tokenizer_backend = tokenizer_backend
...@@ -499,7 +499,7 @@ class TemplateAPI(TemplateLM): ...@@ -499,7 +499,7 @@ class TemplateAPI(TemplateLM):
stop=stop_after_attempt(self.max_retries), stop=stop_after_attempt(self.max_retries),
wait=wait_exponential(multiplier=0.5, min=1, max=10), wait=wait_exponential(multiplier=0.5, min=1, max=10),
reraise=True, reraise=True,
)(self.model_call)(messages=self.create_message(inputs), generate=False) )(self.model_call)(messages=inputs, generate=False)
if isinstance(outputs, dict): if isinstance(outputs, dict):
outputs = [outputs] outputs = [outputs]
for answer_, cache_key in zip( for answer_, cache_key in zip(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment