This commit is contained in:
hiyouga
2024-03-09 21:35:24 +08:00
parent af0e370fb1
commit 412c52e325
5 changed files with 14 additions and 1 deletions

View File

@@ -36,7 +36,6 @@ class HuggingfaceEngine(BaseEngine):
self.tokenizer.padding_side = "left" if self.can_generate else "right"
self.template = get_template_and_fix_tokenizer(self.tokenizer, data_args.template)
self.generating_args = generating_args.to_dict()
self._semaphore = asyncio.Semaphore(int(os.environ.get("MAX_CONCURRENT", 1)))
@staticmethod
def _process_args(
@@ -191,6 +190,9 @@ class HuggingfaceEngine(BaseEngine):
return scores
async def start(self) -> None:
self._semaphore = asyncio.Semaphore(int(os.environ.get("MAX_CONCURRENT", 1)))
async def chat(
self,
messages: Sequence[Dict[str, str]],