소스 검색

Okay we should probably await the update

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

+ 1 - 1
exo/inference/mlx/sharded_inference_engine.py

@@ -93,8 +93,8 @@ class MLXDynamicShardInferenceEngine(InferenceEngine):
     l = mx.array(lengths)
     loop = asyncio.get_running_loop()
     score, grad = await loop.run_in_executor(self.executor, self.session['LVaG'], self.model, x, y, l)
-    loop.run_in_executor(self.executor, self.update_model, grad, score)
     layers = [{k: v["weight"].shape for k,v in l.items() if 'weight' in v} for l in grad['model']['model']['layers'] if l]
+    await loop.run_in_executor(self.executor, self.update_model, grad, score)
 
     return np.array(score).reshape(inputs.shape[0], -1), np.array(layers[0]['input_layernorm']).reshape(inputs.shape[0], -1)