From 7e2380e4edc7a37f3f217b291e928afc36376fd3 Mon Sep 17 00:00:00 2001 From: josc146 Date: Thu, 28 Dec 2023 23:53:58 +0800 Subject: [PATCH] fix body.state --- backend-python/routes/state_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend-python/routes/state_cache.py b/backend-python/routes/state_cache.py index 6178daa..6c124be 100644 --- a/backend-python/routes/state_cache.py +++ b/backend-python/routes/state_cache.py @@ -94,7 +94,7 @@ def add_state(body: AddStateBody): state: Union[Any, None] = None if body.state is not None: - if type(state) == list and hasattr(state[0], "device"): # torch + if type(body.state) == list and hasattr(body.state[0], "device"): # torch devices = [tensor.device for tensor in body.state] state = [tensor.cpu() for tensor in body.state] elif type(body.state) == np.ndarray: # rwkv.cpp