File size: 938 Bytes
9485e3f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
"""Package FSI_Edge source for Colab upload."""
import zipfile, os

SRC = '/FSI_Edge'
FILES = [
    'src/model.py', 'src/data.py',
    'training/train.py',
    'export/export_gguf.py',
    'data/prepare_data.py', 'data/generate_coldstart.py',
]
DEST = '/FSI_Edge/fsi_edge_colab.zip'

with zipfile.ZipFile(DEST, 'w', zipfile.ZIP_DEFLATED) as z:
    for f in FILES:
        z.write(os.path.join(SRC, f), arcname=f'FSI_Edge/{f}')
    # Also include the tokenizer files
    tok_dir = os.path.join(SRC, 'fsi_edge_tokenizer')
    if os.path.exists(tok_dir):
        for root, _, files in os.walk(tok_dir):
            for fn in files:
                full = os.path.join(root, fn)
                arcname = os.path.relpath(full, SRC)
                z.write(full, arcname=f'FSI_Edge/{arcname}')

print(f'Created {DEST} ({os.path.getsize(DEST)/1024:.0f} KB)')
print('Upload to Colab: files.upload() or drag to /content/')