Spaces:
Running
Running
Commit ·
55b687e
1
Parent(s): b69de73
updated directory config.
Browse files- .gitignore +4 -2
- lilyscript/generator.py +2 -2
.gitignore
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
#
|
| 2 |
-
models/
|
| 3 |
|
| 4 |
# Generated outputs written at runtime.
|
| 5 |
outputs/
|
|
@@ -7,3 +7,5 @@ outputs/
|
|
| 7 |
__pycache__/
|
| 8 |
*.pyc
|
| 9 |
.DS_Store
|
|
|
|
|
|
|
|
|
| 1 |
+
# Model weights + geometry — loaded from a local dir for now (LFS / HF hub later).
|
| 2 |
+
models/
|
| 3 |
|
| 4 |
# Generated outputs written at runtime.
|
| 5 |
outputs/
|
|
|
|
| 7 |
__pycache__/
|
| 8 |
*.pyc
|
| 9 |
.DS_Store
|
| 10 |
+
|
| 11 |
+
*.local
|
lilyscript/generator.py
CHANGED
|
@@ -58,7 +58,7 @@ class StreamingLilyletGenerator:
|
|
| 58 |
def __init__ (self, model_dir, asset_dir, threads=None):
|
| 59 |
from .tokenizer import LilyletTokenizer
|
| 60 |
|
| 61 |
-
geo = json.load(open(os.path.join(
|
| 62 |
self.patch_size = geo['patch_size']
|
| 63 |
self.pad_id = geo['pad_id']
|
| 64 |
self.bos_id = geo['bos_id']
|
|
@@ -73,7 +73,7 @@ class StreamingLilyletGenerator:
|
|
| 73 |
self.t_head_dim = geo['token']['head_dim']
|
| 74 |
|
| 75 |
self.tokenizer = LilyletTokenizer(os.path.join(asset_dir, 'lilylet-tokenizer.json'))
|
| 76 |
-
self.wte = np.load(os.path.join(
|
| 77 |
|
| 78 |
so = ort.SessionOptions()
|
| 79 |
if threads:
|
|
|
|
| 58 |
def __init__ (self, model_dir, asset_dir, threads=None):
|
| 59 |
from .tokenizer import LilyletTokenizer
|
| 60 |
|
| 61 |
+
geo = json.load(open(os.path.join(model_dir, 'geometry.json')))
|
| 62 |
self.patch_size = geo['patch_size']
|
| 63 |
self.pad_id = geo['pad_id']
|
| 64 |
self.bos_id = geo['bos_id']
|
|
|
|
| 73 |
self.t_head_dim = geo['token']['head_dim']
|
| 74 |
|
| 75 |
self.tokenizer = LilyletTokenizer(os.path.join(asset_dir, 'lilylet-tokenizer.json'))
|
| 76 |
+
self.wte = np.load(os.path.join(model_dir, 'wte.npy')) # [vocab, hidden] — model weight, lives with the onnx
|
| 77 |
|
| 78 |
so = ort.SessionOptions()
|
| 79 |
if threads:
|