remove semaphore logic from EmbeddingFunc(cause num of instances is already control by limit_async_func_call)
This commit is contained in:
parent
60b66b95e3
commit
1192727be7
1 changed files with 1 additions and 8 deletions
|
|
@ -60,15 +60,8 @@ class EmbeddingFunc:
|
|||
func: callable
|
||||
concurrent_limit: int = 16
|
||||
|
||||
def __post_init__(self):
|
||||
if self.concurrent_limit != 0:
|
||||
self._semaphore = asyncio.Semaphore(self.concurrent_limit)
|
||||
else:
|
||||
self._semaphore = UnlimitedSemaphore()
|
||||
|
||||
async def __call__(self, *args, **kwargs) -> np.ndarray:
|
||||
async with self._semaphore:
|
||||
return await self.func(*args, **kwargs)
|
||||
return await self.func(*args, **kwargs)
|
||||
|
||||
|
||||
def locate_json_string_body_from_string(content: str) -> Union[str, None]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue