ncoop57 commited on
Commit
4671e61
1 Parent(s): 898b5fd

Add authorizing through environment var

Browse files
Files changed (1) hide show
  1. app.py +1 -9
app.py CHANGED
@@ -6,14 +6,6 @@ from functools import partial
6
  from datasets import load_dataset
7
  from pathlib import Path
8
 
9
- # get secret environment variable
10
- token = os.environ["HF_TOKEN"]
11
- # write to disk
12
- path = Path("./huggingface")
13
- path.mkdir(parents=True, exist_ok=True)
14
- with open(path/"token", "w") as f:
15
- f.write(token)
16
-
17
  dataset_names = [
18
  "AI4Code",
19
  "AMPS",
@@ -44,7 +36,7 @@ for name in dataset_names:
44
  ds = load_dataset(
45
  "CarperAI/pilev2_smol_metadata",
46
  data_files=path,
47
- use_auth_token=True,
48
  split="train",
49
  # download_mode="force_redownload",
50
  )
 
6
  from datasets import load_dataset
7
  from pathlib import Path
8
 
 
 
 
 
 
 
 
 
9
  dataset_names = [
10
  "AI4Code",
11
  "AMPS",
 
36
  ds = load_dataset(
37
  "CarperAI/pilev2_smol_metadata",
38
  data_files=path,
39
+ use_auth_token=os.environ["HF_TOKEN"],
40
  split="train",
41
  # download_mode="force_redownload",
42
  )