Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
allamo_pytorch
Commits
89b5c982
Commit
89b5c982
authored
Nov 28, 2024
by
chenzk
Browse files
v1.0.55
parent
f0ee8b73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
allamo/dataset/dataset.py
allamo/dataset/dataset.py
+1
-1
inference/sample.py
inference/sample.py
+1
-1
No files found.
allamo/dataset/dataset.py
View file @
89b5c982
...
...
@@ -64,7 +64,7 @@ class AllamoDataset:
self
.
processed_files
.
append
(
load_dataset_file
)
new_data
=
None
if
load_dataset_file
.
endswith
(
'.bin'
):
assert
self
.
training_type
==
'pre'
,
'NumPy format is supported only for pre-training'
#
assert self.training_type == 'pre', 'NumPy format is supported only for pre-training'
step_size
=
self
.
world_size
*
self
.
sample_size
new_data
=
torch
.
from_numpy
(
np
.
fromfile
(
load_dataset_file
,
dtype
=
np
.
uint16
).
astype
(
np
.
int16
))
if
step_size
>
len
(
new_data
):
...
...
inference/sample.py
View file @
89b5c982
...
...
@@ -68,7 +68,7 @@ class AllamoSampler:
else
:
raise
Exception
(
'Tokenizer is not provided. Please specify either a Tiktoken tokenizer or a HuggingFace tokenizer'
)
# ensure that the tokenizer and model vocabulary sizes are equal
assert
len
(
tokenizer
)
==
self
.
model
.
config
.
vocab_size
#
assert len(tokenizer) == self.model.config.vocab_size
self
.
tokenizer
=
tokenizer
def
tokenize_prompt
(
self
,
text
:
str
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment