Adding the HF_TOKEN to gradio_client
Browse files- src/utilities.py +3 -1
src/utilities.py
CHANGED
|
@@ -14,6 +14,8 @@ OG_DATASET = f"{USERNAME}/dataset-creator-reddit-{SUBREDDIT}"
|
|
| 14 |
PROCESSED_DATASET = os.environ['PROCESSED_DATASET']
|
| 15 |
embeddings_space = f"{USERNAME}/nomic-embeddings"
|
| 16 |
FILTER_IDS_URL = "https://huggingface.co/spaces/reddit-tools-HF/dataset-creator-reddit-bestofredditorupdates/raw/main/filter_ids.json"
|
|
|
|
|
|
|
| 17 |
|
| 18 |
logger = setup_logger(__name__)
|
| 19 |
|
|
@@ -32,7 +34,7 @@ def load_datasets():
|
|
| 32 |
|
| 33 |
def merge_and_update_datasets(dataset, original_dataset):
|
| 34 |
# Get client
|
| 35 |
-
client = Client(embeddings_space)
|
| 36 |
|
| 37 |
# Merge and figure out which rows need to be updated with embeddings
|
| 38 |
odf = original_dataset['train'].to_pandas()
|
|
|
|
| 14 |
PROCESSED_DATASET = os.environ['PROCESSED_DATASET']
|
| 15 |
embeddings_space = f"{USERNAME}/nomic-embeddings"
|
| 16 |
FILTER_IDS_URL = "https://huggingface.co/spaces/reddit-tools-HF/dataset-creator-reddit-bestofredditorupdates/raw/main/filter_ids.json"
|
| 17 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
| 18 |
+
|
| 19 |
|
| 20 |
logger = setup_logger(__name__)
|
| 21 |
|
|
|
|
| 34 |
|
| 35 |
def merge_and_update_datasets(dataset, original_dataset):
|
| 36 |
# Get client
|
| 37 |
+
client = Client(embeddings_space, hf_token=HF_TOKEN)
|
| 38 |
|
| 39 |
# Merge and figure out which rows need to be updated with embeddings
|
| 40 |
odf = original_dataset['train'].to_pandas()
|