Get token from environment
Browse files
utils.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import logging
|
2 |
import re
|
|
|
3 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
4 |
from typing import Dict, List, Union
|
5 |
from urllib.parse import urljoin, urlparse
|
@@ -9,7 +10,7 @@ from bs4 import BeautifulSoup
|
|
9 |
|
10 |
from huggingface_hub import HfApi
|
11 |
|
12 |
-
HF_API = HfApi()
|
13 |
|
14 |
|
15 |
def get_base_url(url: str) -> str:
|
|
|
1 |
import logging
|
2 |
import re
|
3 |
+
import os
|
4 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
5 |
from typing import Dict, List, Union
|
6 |
from urllib.parse import urljoin, urlparse
|
|
|
10 |
|
11 |
from huggingface_hub import HfApi
|
12 |
|
13 |
+
HF_API = HfApi(token=os.environ.get("TOKEN", None))
|
14 |
|
15 |
|
16 |
def get_base_url(url: str) -> str:
|