Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/data/c4.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
import os


hf_tknzr = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
# Lazy/guarded: meta-llama/Llama-2-7b-hf is a GATED repo (403 without auth). Only c4 needs it;
# importing this module (e.g. for wikitext) must not fail at import time.
try:
hf_tknzr = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
except Exception:
hf_tknzr = None


def get_c4_data(datasets_dir, num_proc=40):
Expand Down