Python bindings for the Tannic framework
Project description
PyTannic
Python bindings for the Tannic framework.
PyTannic is a Python library for interacting with the Tannic-NN framework. It provides utilities for serializing PyTorch models, handling metadata, and sending/receiving tensor data over TCP in a format compatible with Tannic-NN.
Features
- Serialize
torch.nn.Moduleparameters. - Network client for sending/receiving serialized tensors.
Installation
pip install pytannic
Quick Start
Write trained modules to files to load them from the C++ Tannic framework.
from pytannic.torch.modules import write
from torch.nn import Linear
module = Linear(10, 5)
write(module, "linear_model")
PyTannic allows you to send serialized PyTorch tensors to a Tannic server and receive responses.
tensor = torch.randn(3, 3)
with Client("127.0.0.1", 8080) as client:
client.send(serialize(tensor)
data = client.receive()
result = deserialize(data)
print("Sent tensor:")
print(tensor)
print("\nReceived tensor:")
print(response)
This will allow you to easily create inference servers in C++. For a complete MNIST server example, see the mnist-server repository.
License
Tannic is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytannic-0.1.3.tar.gz.
File metadata
- Download URL: pytannic-0.1.3.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.1 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae1d9462c777053fdd5059e29e3fafa0c56fda7aa4eb27f6916b94c436cc14cb
|
|
| MD5 |
5ebc3cb8b5111693cf7a3242562d11a1
|
|
| BLAKE2b-256 |
1742f4f7d973099a23bc70d50f86540ee85d3115dbbacf07b8de774d2b2bcc63
|
File details
Details for the file pytannic-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pytannic-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.4 CPython/3.12.1 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da264838d70adf36746f60b1d7341efab72face1916a63bd2ca30d459f7a3dc5
|
|
| MD5 |
cd408870d771b2178a44ce61ff150542
|
|
| BLAKE2b-256 |
690487a9c93247294669fe3621ad3ab5e0a483201ff68f09f532700e745ff08e
|