OSainz commited on
Commit
76cf558
β€’
1 Parent(s): 5a41656

Get token from environment

Browse files
Files changed (1) hide show
  1. utils.py +2 -1
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: