Spaces:
Sleeping
Sleeping
Commit
·
b380276
1
Parent(s):
169c4de
update key for hf token
Browse files
app.py
CHANGED
|
@@ -137,6 +137,12 @@ def main():
|
|
| 137 |
|
| 138 |
def save_results(answers):
|
| 139 |
api = HfApi()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
json_file_results = config['results']['exp1_dir'] # 'exp1'
|
| 141 |
JSON_DATASET_DIR = Path("json_dataset")
|
| 142 |
JSON_DATASET_DIR.mkdir(parents=True, exist_ok=True)
|
|
@@ -163,7 +169,7 @@ def main():
|
|
| 163 |
}, f)
|
| 164 |
f.write("\n")
|
| 165 |
scheduler.push_to_hub()
|
| 166 |
-
|
| 167 |
|
| 168 |
def add_answer(dropdown1,dropdown2,dropdown3,dropdown4, answers):
|
| 169 |
rank = [dropdown1,dropdown2,dropdown3,dropdown4]
|
|
|
|
| 137 |
|
| 138 |
def save_results(answers):
|
| 139 |
api = HfApi()
|
| 140 |
+
api_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 141 |
+
if not api_token:
|
| 142 |
+
raise ValueError("Hugging Face API token not found. Please set the HF_API_TOKEN environment variable.")
|
| 143 |
+
|
| 144 |
+
api.set_access_token(api_token)
|
| 145 |
+
|
| 146 |
json_file_results = config['results']['exp1_dir'] # 'exp1'
|
| 147 |
JSON_DATASET_DIR = Path("json_dataset")
|
| 148 |
JSON_DATASET_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
| 169 |
}, f)
|
| 170 |
f.write("\n")
|
| 171 |
scheduler.push_to_hub()
|
| 172 |
+
|
| 173 |
|
| 174 |
def add_answer(dropdown1,dropdown2,dropdown3,dropdown4, answers):
|
| 175 |
rank = [dropdown1,dropdown2,dropdown3,dropdown4]
|