MCPcopy
hub / github.com/ModelTC/LightLLM / bytes2tensor

Function bytes2tensor

lightllm/server/embed_cache/utils.py:23–25  ·  view source on GitHub ↗
(b)

Source from the content-addressed store, hash-verified

21
22
23def bytes2tensor(b):
24 # return torch.from_numpy(np.frombuffer(b, dtype=np.float16)).cuda()
25 return torch.load(BytesIO(b), weights_only=False)
26
27
28def create_shm(name, data):

Callers 2

context_forwardMethod · 0.90
context_forwardMethod · 0.90

Calls 1

loadMethod · 0.80

Tested by

no test coverage detected