Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scalable-c4-preprocessing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joel Dag
scalable-c4-preprocessing
Commits
0a2171b0
Commit
0a2171b0
authored
1 month ago
by
joeld
Browse files
Options
Downloads
Patches
Plain Diff
added commetns
parent
1f6f3a8e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
data_loader.py
+1
-0
1 addition, 0 deletions
data_loader.py
main.py
+1
-0
1 addition, 0 deletions
main.py
processor.py
+1
-0
1 addition, 0 deletions
processor.py
with
3 additions
and
0 deletions
data_loader.py
+
1
−
0
View file @
0a2171b0
...
...
@@ -17,6 +17,7 @@ class DataLoader:
os
.
makedirs
(
self
.
output_dir
,
exist_ok
=
True
)
def
partition_data
(
self
):
"""
this partitions files among processes and writes assigned data to a shard file for better testing/debugging
"""
master_list
=
get_master_file_list
(
self
.
input_dir
)
assigned_files
=
[
file_path
for
idx
,
file_path
in
enumerate
(
master_list
)
...
...
This diff is collapsed.
Click to expand it.
main.py
+
1
−
0
View file @
0a2171b0
...
...
@@ -28,6 +28,7 @@ def main():
lines_count
,
tokens_count
=
processor
.
process
()
processing_time
=
time
.
time
()
-
start_processing
# minimal processing statistics/timing for eval
total_time
=
time
.
time
()
-
start_total
avg_tokens
=
tokens_count
/
lines_count
if
lines_count
else
0
print
(
f
"
Proc
{
args
.
proc_rank
}
: Partition
{
partition_time
:
.
2
f
}
s, Processing
{
processing_time
:
.
2
f
}
s,
"
...
...
This diff is collapsed.
Click to expand it.
processor.py
+
1
−
0
View file @
0a2171b0
...
...
@@ -12,6 +12,7 @@ class ShardProcessor:
self
.
batch_size
=
batch_size
def
process
(
self
):
"""
preprocesses text which is currently only splitting + lowering text, writes tokenized batches to the output file
"""
lines_count
=
0
tokens_count
=
0
try
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment