CarlosMalaga commited on
Commit
f13cbf8
1 Parent(s): a9b6a2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -249,18 +249,23 @@ def set_intro(css):
249
 
250
  from datetime import datetime
251
  from pathlib import Path
252
- from huggingface_hub import CommitScheduler
253
  from uuid import uuid4
254
 
255
- JSON_DATASET_DIR = Path("json_dataset")
 
 
 
 
256
  JSON_DATASET_DIR.mkdir(parents=True, exist_ok=True)
257
  JSON_DATASET_PATH = JSON_DATASET_DIR / f"train-{uuid4()}.json"
258
 
259
  scheduler = CommitScheduler(
260
- repo_id="example-space-to-dataset-json",
261
  repo_type="dataset",
262
  folder_path=JSON_DATASET_DIR,
263
  path_in_repo="data",
 
264
  )
265
 
266
 
 
249
 
250
  from datetime import datetime
251
  from pathlib import Path
252
+ from huggingface_hub import HfApi, CommitScheduler
253
  from uuid import uuid4
254
 
255
+ # Access token from environment variable
256
+ api = HfApi()
257
+ api.set_access_token(os.getenv("HF_TOKEN"))
258
+
259
+ JSON_DATASET_DIR = Path("json_demo_selected_io")
260
  JSON_DATASET_DIR.mkdir(parents=True, exist_ok=True)
261
  JSON_DATASET_PATH = JSON_DATASET_DIR / f"train-{uuid4()}.json"
262
 
263
  scheduler = CommitScheduler(
264
+ repo_id="demo-retriever",
265
  repo_type="dataset",
266
  folder_path=JSON_DATASET_DIR,
267
  path_in_repo="data",
268
+ hf_api=api
269
  )
270
 
271