소스 검색

Some session method cleanup

Nel Nibcord 8 달 전
부모
커밋
b22c21ac16
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      exo/inference/inference_engine.py

+ 1 - 5
exo/inference/inference_engine.py

@@ -35,12 +35,8 @@ class InferenceEngine(ABC):
       if hook is not None:
       if hook is not None:
         hook()
         hook()
   
   
-  async def ensure_session_match(self, key, check, value_gen):
-    if key not in self.session or not check(self.session[key]):
-      await self.save_session(key, value_gen())
-  
   async def clear_session(self):
   async def clear_session(self):
-    session.empty()
+    self.session.empty()
   
   
   async def infer_prompt(self, request_id: str, shard: Shard, prompt: str) -> np.ndarray:
   async def infer_prompt(self, request_id: str, shard: Shard, prompt: str) -> np.ndarray:
     tokens = await self.encode(shard, prompt)
     tokens = await self.encode(shard, prompt)