File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,6 +186,12 @@ function(hf_download version out_var out_resolved)
186186
187187 set (archive "${UI_BINARY_DIR } /dist.tar.gz" )
188188
189+ # Use HF_TOKEN to benefit from higher rate limits
190+ set (auth_headers "" )
191+ if (DEFINED ENV{HF_TOKEN} AND NOT "$ENV{HF_TOKEN} " STREQUAL "" )
192+ list (APPEND auth_headers "HTTPHEADER" "Authorization: Bearer $ENV{HF_TOKEN} " )
193+ endif ()
194+
189195 set (candidates "" )
190196 if (NOT "${version} " STREQUAL "" )
191197 list (APPEND candidates "${version} " )
@@ -198,7 +204,7 @@ function(hf_download version out_var out_resolved)
198204 message (STATUS "UI: downloading from ${resolved} : ${base} /dist.tar.gz" )
199205
200206 file (DOWNLOAD "${base} /dist.tar.gz?download=true" "${archive} "
201- STATUS status TIMEOUT 300
207+ STATUS status TIMEOUT 300 ${auth_headers}
202208 )
203209 list (GET status 0 rc)
204210 if (NOT rc EQUAL 0)
@@ -208,7 +214,7 @@ function(hf_download version out_var out_resolved)
208214 endif ()
209215
210216 file (DOWNLOAD "${base} /dist.tar.gz.sha256?download=true" "${archive} .sha256"
211- STATUS status TIMEOUT 30
217+ STATUS status TIMEOUT 30 ${auth_headers}
212218 )
213219 list (GET status 0 rc)
214220 if (NOT rc EQUAL 0)
You can’t perform that action at this time.
0 commit comments