فهرست منبع

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:
         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):
-    session.empty()
+    self.session.empty()
   
   async def infer_prompt(self, request_id: str, shard: Shard, prompt: str) -> np.ndarray:
     tokens = await self.encode(shard, prompt)