feat: Check serialization for AWEL operator function

This commit is contained in:
Fangyin Cheng
2024-09-04 22:08:55 +08:00
parent b1ca247419
commit f8ce7d4580
12 changed files with 236 additions and 4 deletions

View File

@@ -94,6 +94,17 @@ class ProxyLLMClient(LLMClient):
self.executor = executor or ThreadPoolExecutor()
self.proxy_tokenizer = proxy_tokenizer or TiktokenProxyTokenizer()
def __getstate__(self):
"""Customize the serialization of the object"""
state = self.__dict__.copy()
state.pop("executor")
return state
def __setstate__(self, state):
"""Customize the deserialization of the object"""
self.__dict__.update(state)
self.executor = ThreadPoolExecutor()
@classmethod
@abstractmethod
def new_client(