chore: Start compression path

This commit is contained in:
Tibo De Peuter 2025-12-05 12:38:10 +01:00
parent f32f4678e1
commit 9dff723bba
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
4 changed files with 147 additions and 94 deletions

23
src/process.py Normal file
View file

@ -0,0 +1,23 @@
import torch
def compress(
input_file: str | None = None
):
if input_file:
with open(input_file, "rb") as file:
byte_data = file.read()
else:
# Read from stdin
text = input()
byte_data = text.encode('utf-8', errors='replace')
tensor = torch.tensor(list(byte_data), dtype=torch.long)
print(tensor)
# TODO Feed to model for compression, store result
return
def decompress():
return NotImplementedError("Decompression is not implemented yet")