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
OpenDAS
AutoAWQ
Commits
af4e0622
"src/vscode:/vscode.git/clone" did not exist on "ff573ae245166d8b958950f68eb65ea766f07f69"
Commit
af4e0622
authored
Aug 18, 2023
by
Casper Hansen
Browse files
Implement fallback calibration dataset (wikitext).
parent
ed347704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
awq/utils/calib_data.py
awq/utils/calib_data.py
+6
-2
No files found.
awq/utils/calib_data.py
View file @
af4e0622
import
torch
from
datasets
import
load_dataset
from
datasets.builder
import
DatasetGenerationError
def
get_calib_dataset
(
data
=
"pileval"
,
tokenizer
=
None
,
n_samples
=
512
,
block_size
=
512
):
if
data
==
"pileval"
:
dataset
=
load_dataset
(
"json"
,
data_files
=
"https://the-eye.eu/public/AI/pile/val.jsonl.zst"
,
split
=
"train"
)
try
:
dataset
=
load_dataset
(
"json"
,
data_files
=
"https://the-eye.eu/public/AI/pile/val.jsonl.zst"
,
split
=
"train"
)
except
DatasetGenerationError
:
print
(
'The Pile URL is down, using wikitext-103-raw-v1 instead'
)
dataset
=
load_dataset
(
'wikitext'
,
"wikitext-103-raw-v1"
,
split
=
"train"
)
else
:
raise
NotImplementedError
dataset
=
dataset
.
shuffle
(
seed
=
42
)
...
...
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