Danielrahmai1991 commited on
Commit
1f23a52
·
verified ·
1 Parent(s): cdde01e

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +2 -1
utils.py CHANGED
@@ -2,6 +2,7 @@ from datasets import Dataset, concatenate_datasets
2
  from huggingface_hub import login
3
  import os
4
  from datasets import load_dataset
 
5
 
6
 
7
  def update_db_hub(texts, topics, dates):
@@ -19,7 +20,7 @@ def update_db_hub(texts, topics, dates):
19
 
20
  try:
21
  # Load the dataset (use_auth_token=True if it's private)
22
- dataset = load_dataset(dataset_name, use_auth_token=True)
23
  print("Dataset loaded successfully!", dataset)
24
  # print(dataset)
25
  updated_dataset = concatenate_datasets([dataset['train'], new_dataset])
 
2
  from huggingface_hub import login
3
  import os
4
  from datasets import load_dataset
5
+ from datasets import DownloadConfig
6
 
7
 
8
  def update_db_hub(texts, topics, dates):
 
20
 
21
  try:
22
  # Load the dataset (use_auth_token=True if it's private)
23
+ dataset = load_dataset(dataset_name, download_config=DownloadConfig(token=api_token))
24
  print("Dataset loaded successfully!", dataset)
25
  # print(dataset)
26
  updated_dataset = concatenate_datasets([dataset['train'], new_dataset])