Spaces:
Runtime error
Runtime error
Thomas G. Lopes
commited on
Commit
·
7260a80
1
Parent(s):
6961b4c
fix models 401
Browse files
src/routes/api/models/+server.ts
CHANGED
|
@@ -18,9 +18,22 @@ export const GET: RequestHandler = async ({ fetch }) => {
|
|
| 18 |
const HF_TOKEN = env.HF_TOKEN;
|
| 19 |
|
| 20 |
const res = await fetch(apiUrl, {
|
|
|
|
| 21 |
headers: {
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
},
|
|
|
|
|
|
|
| 24 |
});
|
| 25 |
|
| 26 |
if (!res.ok) {
|
|
|
|
| 18 |
const HF_TOKEN = env.HF_TOKEN;
|
| 19 |
|
| 20 |
const res = await fetch(apiUrl, {
|
| 21 |
+
credentials: "include",
|
| 22 |
headers: {
|
| 23 |
+
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:135.0) Gecko/20100101 Firefox/135.0",
|
| 24 |
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
| 25 |
+
"Accept-Language": "en-US,en;q=0.5",
|
| 26 |
+
"Upgrade-Insecure-Requests": "1",
|
| 27 |
+
"Sec-Fetch-Dest": "document",
|
| 28 |
+
"Sec-Fetch-Mode": "navigate",
|
| 29 |
+
"Sec-Fetch-Site": "none",
|
| 30 |
+
"Sec-Fetch-User": "?1",
|
| 31 |
+
"Priority": "u=0, i",
|
| 32 |
+
"Pragma": "no-cache",
|
| 33 |
+
"Cache-Control": "no-cache",
|
| 34 |
},
|
| 35 |
+
method: "GET",
|
| 36 |
+
mode: "cors",
|
| 37 |
});
|
| 38 |
|
| 39 |
if (!res.ok) {
|