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
a1aa84cc
Commit
a1aa84cc
authored
Aug 22, 2023
by
Casper
Browse files
Merge remote-tracking branch 'upstream/main' into refactor-models
parents
2a243105
f3a90b77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
awq/utils/calib_data.py
awq/utils/calib_data.py
+1
-6
No files found.
awq/utils/calib_data.py
View file @
a1aa84cc
import
torch
import
torch
from
datasets
import
load_dataset
from
datasets
import
load_dataset
from
datasets.builder
import
DatasetGenerationError
def
get_calib_dataset
(
data
=
"pileval"
,
tokenizer
=
None
,
n_samples
=
512
,
block_size
=
512
):
def
get_calib_dataset
(
data
=
"pileval"
,
tokenizer
=
None
,
n_samples
=
512
,
block_size
=
512
):
if
data
==
"pileval"
:
if
data
==
"pileval"
:
try
:
dataset
=
load_dataset
(
"mit-han-lab/pile-val-backup"
,
split
=
"validation"
)
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
:
else
:
raise
NotImplementedError
raise
NotImplementedError
dataset
=
dataset
.
shuffle
(
seed
=
42
)
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