MCPcopy Create free account
hub / github.com/boyiwei/alignment-attribution-code / get_wikitext2

Function get_wikitext2

lib/data.py:63–68  ·  view source on GitHub ↗
(nsamples, seed, seqlen, tokenizer)

Source from the content-addressed store, hash-verified

61
62# Load and process wikitext2 dataset
63def get_wikitext2(nsamples, seed, seqlen, tokenizer):
64 # Load train and test datasets
65 testdata = load_dataset("wikitext", "wikitext-2-raw-v1", split="test")
66 testenc = tokenizer("\n\n".join(testdata["text"]), return_tensors="pt")
67
68 return None, testenc
69
70
71def get_alpaca(nsamples, seed, seqlen, tokenizer, disentangle=False, dataset="alpaca"):

Callers 1

get_loadersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected