Update tensor_server.py
Browse files- tensor_server.py +9 -9
tensor_server.py
CHANGED
|
@@ -191,16 +191,16 @@ def load_chunk(chunk: ModelChunk) -> torch.nn.Module:
|
|
| 191 |
return logits
|
| 192 |
|
| 193 |
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
|
| 202 |
-
|
| 203 |
-
|
| 204 |
|
| 205 |
async def process_tensor(chunk_id: int, inputs: torch.Tensor) -> torch.Tensor:
|
| 206 |
"""Process input tensor through the specified chunk"""
|
|
|
|
| 191 |
return logits
|
| 192 |
|
| 193 |
|
| 194 |
+
# Create and return the chunk buffer
|
| 195 |
+
chunk_model = ChunkBuffer(chunk_file, chunk_config)
|
| 196 |
+
# Ensure the chunk_model.config is the up-to-date config (including any assigned offsets)
|
| 197 |
+
chunk_model.config = chunk_config
|
| 198 |
+
print(f"[INFO] Loaded chunk {chunk.chunk_id} ({chunk_config.get('size_bytes', 0)} bytes) from {chunk.files[0]}")
|
| 199 |
+
|
| 200 |
+
return chunk_model
|
| 201 |
|
| 202 |
+
except Exception as e:
|
| 203 |
+
raise Exception(f"Failed to load chunk: {str(e)}")
|
| 204 |
|
| 205 |
async def process_tensor(chunk_id: int, inputs: torch.Tensor) -> torch.Tensor:
|
| 206 |
"""Process input tensor through the specified chunk"""
|