@gradio/client 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/browser.js +187 -175
- package/dist/helpers/init_helpers.d.ts.map +1 -1
- package/dist/index.js +20 -8
- package/dist/types.d.ts +2 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/helpers/init_helpers.ts +23 -10
- package/src/test/init_helpers.test.ts +0 -10
- package/src/types.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @gradio/client
|
|
2
2
|
|
|
3
|
+
## 1.19.1
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#11955](https://github.com/gradio-app/gradio/pull/11955) [`64046cc`](https://github.com/gradio-app/gradio/commit/64046ccd76a41f06ef9eed0e3aa1ec66348f55bd) - Fix Multi-page demo in Dev Mode. Thanks @ftoh!
|
|
8
|
+
|
|
9
|
+
## 1.19.0
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- [#11858](https://github.com/gradio-app/gradio/pull/11858) [`3f8ea13`](https://github.com/gradio-app/gradio/commit/3f8ea13a8ca92abf0ad34392e403a449fda3c6c2) - remove lite. Thanks @pngwn!
|
|
14
|
+
- [#11902](https://github.com/gradio-app/gradio/pull/11902) [`6d39644`](https://github.com/gradio-app/gradio/commit/6d39644ee1000b04728eb4909cee405e7ee3b5b2) - Add navbar visibility controls and customization options. Thanks @abidlabs!
|
|
15
|
+
|
|
16
|
+
### Fixes
|
|
17
|
+
|
|
18
|
+
- [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
|
|
19
|
+
|
|
3
20
|
## 1.18.0
|
|
4
21
|
|
|
5
22
|
### Features
|
package/dist/browser.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var st = Object.defineProperty;
|
|
2
|
+
var ke = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var u = (e, t, s) =>
|
|
7
|
-
var W = (e, t, s) => (
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return e = e.split("."), t = t.split("."),
|
|
5
|
+
var nt = (e, t, s) => t in e ? st(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var u = (e, t, s) => nt(e, typeof t != "symbol" ? t + "" : t, s), Re = (e, t, s) => t.has(e) || ke("Cannot " + s);
|
|
7
|
+
var W = (e, t, s) => (Re(e, t, "read from private field"), s ? s.call(e) : t.get(e)), Oe = (e, t, s) => t.has(e) ? ke("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), Ne = (e, t, s, n) => (Re(e, t, "write to private field"), n ? n.call(e, s) : t.set(e, s), s);
|
|
8
|
+
var fe = new Intl.Collator(0, { numeric: 1 }).compare;
|
|
9
|
+
function xe(e, t, s) {
|
|
10
|
+
return e = e.split("."), t = t.split("."), fe(e[0], t[0]) || fe(e[1], t[1]) || (t[2] = t.slice(2).join("."), s = /[.-]/.test(e[2] = e.slice(2).join(".")), s == /[.-]/.test(t[2]) ? fe(e[2], t[2]) : s ? -1 : 1);
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
function
|
|
12
|
+
const it = "host", Ie = "queue/data", ot = "queue/join", Te = "upload", rt = "login", ee = "config", at = "info", ct = "runtime", lt = "sleeptime", ut = "heartbeat", pt = "component_server", ft = "reset", ht = "cancel", dt = "app_id", _t = "https://gradio-space-api-fetcher-v2.hf.space/api", Ue = "This application is currently busy. Please try again. ", H = "Connection errored out. ", z = "Could not resolve app config. ", mt = "Could not get space status. ", gt = "Could not get API info. ", ge = "Space metadata could not be loaded. ", wt = "Invalid URL. A full URL path is required.", yt = "Not authorized to access this space. ", qe = "Invalid credentials. Could not login. ", bt = "Login credentials are required to access this space.", vt = "File system access is only available in Node.js environments", ze = "Root URL not found in client config", Et = "Error uploading file";
|
|
13
|
+
function St(e, t, s) {
|
|
14
14
|
return t.startsWith("http://") || t.startsWith("https://") ? s ? e : t : e + t;
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function De(e, t, s) {
|
|
17
17
|
try {
|
|
18
18
|
return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, {
|
|
19
19
|
headers: {
|
|
@@ -25,53 +25,71 @@ async function Te(e, t, s) {
|
|
|
25
25
|
return !1;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function $t(e) {
|
|
29
29
|
let t = {};
|
|
30
30
|
return e.forEach(({ api_name: s, id: n }) => {
|
|
31
31
|
s && (t[s] = n);
|
|
32
32
|
}), t;
|
|
33
33
|
}
|
|
34
|
-
async function
|
|
34
|
+
async function kt(e) {
|
|
35
35
|
const t = this.options.hf_token ? { Authorization: `Bearer ${this.options.hf_token}` } : {};
|
|
36
|
-
if (t["Content-Type"] = "application/json", typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
if (t["Content-Type"] = "application/json", typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876") {
|
|
37
|
+
if (window.gradio_config.current_page && (e = e.substring(0, e.lastIndexOf("/"))), window.gradio_config.dev_mode) {
|
|
38
|
+
let s = _e(
|
|
39
|
+
e,
|
|
40
|
+
this.deep_link ? ee + "?deep_link=" + this.deep_link : ee
|
|
41
|
+
);
|
|
42
|
+
const n = await this.fetch(s, {
|
|
43
|
+
headers: t,
|
|
44
|
+
credentials: "include"
|
|
45
|
+
}), i = await Ce(
|
|
46
|
+
n,
|
|
47
|
+
e,
|
|
48
|
+
!!this.options.auth
|
|
49
|
+
);
|
|
50
|
+
window.gradio_config = {
|
|
51
|
+
...i,
|
|
52
|
+
current_page: window.gradio_config.current_page
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return window.gradio_config.root = e, { ...window.gradio_config };
|
|
56
|
+
} else if (e) {
|
|
57
|
+
let s = _e(
|
|
40
58
|
e,
|
|
41
|
-
this.deep_link ?
|
|
59
|
+
this.deep_link ? ee + "?deep_link=" + this.deep_link : ee
|
|
42
60
|
);
|
|
43
61
|
const n = await this.fetch(s, {
|
|
44
62
|
headers: t,
|
|
45
63
|
credentials: "include"
|
|
46
64
|
});
|
|
47
|
-
return
|
|
65
|
+
return Ce(n, e, !!this.options.auth);
|
|
48
66
|
}
|
|
49
67
|
throw new Error(z);
|
|
50
68
|
}
|
|
51
|
-
async function
|
|
69
|
+
async function Ce(e, t, s) {
|
|
52
70
|
var n, i;
|
|
53
71
|
if ((e == null ? void 0 : e.status) === 401 && !s) {
|
|
54
72
|
const r = await e.json(), o = (n = r == null ? void 0 : r.detail) == null ? void 0 : n.auth_message;
|
|
55
|
-
throw new Error(o ||
|
|
73
|
+
throw new Error(o || bt);
|
|
56
74
|
} else if ((e == null ? void 0 : e.status) === 401 && s)
|
|
57
|
-
throw new Error(
|
|
75
|
+
throw new Error(qe);
|
|
58
76
|
if ((e == null ? void 0 : e.status) === 200) {
|
|
59
77
|
let r = await e.json();
|
|
60
78
|
return r.root = t, (i = r.dependencies) == null || i.forEach((o, a) => {
|
|
61
79
|
o.id === void 0 && (o.id = a);
|
|
62
80
|
}), r;
|
|
63
81
|
} else if ((e == null ? void 0 : e.status) === 401)
|
|
64
|
-
throw new Error(
|
|
82
|
+
throw new Error(yt);
|
|
65
83
|
throw new Error(z);
|
|
66
84
|
}
|
|
67
85
|
async function Rt() {
|
|
68
|
-
const { http_protocol: e, host: t } = await
|
|
86
|
+
const { http_protocol: e, host: t } = await se(
|
|
69
87
|
this.app_reference,
|
|
70
88
|
this.options.hf_token
|
|
71
89
|
);
|
|
72
90
|
try {
|
|
73
91
|
if (this.options.auth) {
|
|
74
|
-
const s = await
|
|
92
|
+
const s = await Be(
|
|
75
93
|
e,
|
|
76
94
|
t,
|
|
77
95
|
this.options.auth,
|
|
@@ -84,12 +102,12 @@ async function Rt() {
|
|
|
84
102
|
throw Error(s.message);
|
|
85
103
|
}
|
|
86
104
|
}
|
|
87
|
-
async function
|
|
105
|
+
async function Be(e, t, s, n, i) {
|
|
88
106
|
const r = new FormData();
|
|
89
107
|
r.append("username", s == null ? void 0 : s[0]), r.append("password", s == null ? void 0 : s[1]);
|
|
90
108
|
let o = {};
|
|
91
109
|
i && (o.Authorization = `Bearer ${i}`);
|
|
92
|
-
const a = await n(`${e}//${t}/${
|
|
110
|
+
const a = await n(`${e}//${t}/${rt}`, {
|
|
93
111
|
headers: o,
|
|
94
112
|
method: "POST",
|
|
95
113
|
body: r,
|
|
@@ -97,9 +115,9 @@ async function qe(e, t, s, n, i) {
|
|
|
97
115
|
});
|
|
98
116
|
if (a.status === 200)
|
|
99
117
|
return a.headers.get("set-cookie");
|
|
100
|
-
throw a.status === 401 ? new Error(
|
|
118
|
+
throw a.status === 401 ? new Error(qe) : new Error(ge);
|
|
101
119
|
}
|
|
102
|
-
function
|
|
120
|
+
function he(e) {
|
|
103
121
|
if (e.startsWith("http")) {
|
|
104
122
|
const { protocol: t, host: s, pathname: n } = new URL(e);
|
|
105
123
|
return {
|
|
@@ -107,45 +125,39 @@ function fe(e) {
|
|
|
107
125
|
http_protocol: t,
|
|
108
126
|
host: s + (n !== "/" ? n : "")
|
|
109
127
|
};
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
ws_protocol: "ws",
|
|
113
|
-
http_protocol: "http:",
|
|
114
|
-
host: "lite.local"
|
|
115
|
-
// Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
|
|
116
|
-
};
|
|
128
|
+
}
|
|
117
129
|
return {
|
|
118
130
|
ws_protocol: "wss",
|
|
119
131
|
http_protocol: "https:",
|
|
120
132
|
host: new URL(e).host
|
|
121
133
|
};
|
|
122
134
|
}
|
|
123
|
-
const
|
|
135
|
+
const Fe = (e) => {
|
|
124
136
|
let t = [];
|
|
125
137
|
return e.split(/,(?=\s*[^\s=;]+=[^\s=;]+)/).forEach((n) => {
|
|
126
138
|
const [i, r] = n.split(";")[0].split("=");
|
|
127
139
|
i && r && t.push(`${i.trim()}=${r.trim()}`);
|
|
128
140
|
}), t;
|
|
129
|
-
},
|
|
130
|
-
async function
|
|
141
|
+
}, we = /^[a-zA-Z0-9_\-\.]+\/[a-zA-Z0-9_\-\.]+$/, Ot = /.*hf\.space\/{0,1}.*$/;
|
|
142
|
+
async function se(e, t) {
|
|
131
143
|
const s = {};
|
|
132
144
|
t && (s.Authorization = `Bearer ${t}`);
|
|
133
145
|
const n = e.trim().replace(/\/$/, "");
|
|
134
|
-
if (
|
|
146
|
+
if (we.test(n))
|
|
135
147
|
try {
|
|
136
148
|
const r = (await (await fetch(
|
|
137
|
-
`https://huggingface.co/api/spaces/${n}/${
|
|
149
|
+
`https://huggingface.co/api/spaces/${n}/${it}`,
|
|
138
150
|
{ headers: s }
|
|
139
151
|
)).json()).host;
|
|
140
152
|
return {
|
|
141
153
|
space_id: e,
|
|
142
|
-
...
|
|
154
|
+
...he(r)
|
|
143
155
|
};
|
|
144
156
|
} catch {
|
|
145
|
-
throw new Error(
|
|
157
|
+
throw new Error(ge);
|
|
146
158
|
}
|
|
147
159
|
if (Ot.test(n)) {
|
|
148
|
-
const { ws_protocol: i, http_protocol: r, host: o } =
|
|
160
|
+
const { ws_protocol: i, http_protocol: r, host: o } = he(n);
|
|
149
161
|
return {
|
|
150
162
|
space_id: o.split("/")[0].replace(".hf.space", ""),
|
|
151
163
|
ws_protocol: i,
|
|
@@ -155,14 +167,14 @@ async function te(e, t) {
|
|
|
155
167
|
}
|
|
156
168
|
return {
|
|
157
169
|
space_id: !1,
|
|
158
|
-
...
|
|
170
|
+
...he(n)
|
|
159
171
|
};
|
|
160
172
|
}
|
|
161
|
-
const
|
|
173
|
+
const _e = (...e) => {
|
|
162
174
|
try {
|
|
163
175
|
return e.reduce((t, s) => (t = t.replace(/\/+$/, ""), s = s.replace(/^\/+/, ""), new URL(s, t + "/").toString()));
|
|
164
176
|
} catch {
|
|
165
|
-
throw new Error(
|
|
177
|
+
throw new Error(wt);
|
|
166
178
|
}
|
|
167
179
|
};
|
|
168
180
|
function Nt(e, t, s) {
|
|
@@ -244,7 +256,7 @@ function Tt(e, t, s, n) {
|
|
|
244
256
|
function Dt(e, t) {
|
|
245
257
|
return t === "GallerySerializable" ? "array of [file, label] tuples" : t === "ListStringSerializable" ? "array of strings" : t === "FileSerializable" ? "array of files or single file" : e == null ? void 0 : e.description;
|
|
246
258
|
}
|
|
247
|
-
function
|
|
259
|
+
function de(e, t) {
|
|
248
260
|
switch (e.msg) {
|
|
249
261
|
case "send_data":
|
|
250
262
|
return { type: "data" };
|
|
@@ -255,7 +267,7 @@ function he(e, t) {
|
|
|
255
267
|
type: "update",
|
|
256
268
|
status: {
|
|
257
269
|
queue: !0,
|
|
258
|
-
message:
|
|
270
|
+
message: Ue,
|
|
259
271
|
stage: "error",
|
|
260
272
|
code: e.code,
|
|
261
273
|
success: e.success
|
|
@@ -417,8 +429,8 @@ async function At() {
|
|
|
417
429
|
if (typeof window < "u" && window.gradio_api_info)
|
|
418
430
|
i = window.gradio_api_info;
|
|
419
431
|
else {
|
|
420
|
-
if (
|
|
421
|
-
n = await this.fetch(
|
|
432
|
+
if (xe((t == null ? void 0 : t.version) || "2.0.0", "3.30") < 0)
|
|
433
|
+
n = await this.fetch(_t, {
|
|
422
434
|
method: "POST",
|
|
423
435
|
body: JSON.stringify({
|
|
424
436
|
serialize: !1,
|
|
@@ -428,7 +440,7 @@ async function At() {
|
|
|
428
440
|
credentials: "include"
|
|
429
441
|
});
|
|
430
442
|
else {
|
|
431
|
-
const r =
|
|
443
|
+
const r = _e(t.root, this.api_prefix, at);
|
|
432
444
|
n = await this.fetch(r, {
|
|
433
445
|
headers: s,
|
|
434
446
|
credentials: "include"
|
|
@@ -455,7 +467,7 @@ async function Lt(e, t, s) {
|
|
|
455
467
|
m.append("files", g);
|
|
456
468
|
});
|
|
457
469
|
try {
|
|
458
|
-
const g = s ? `${e}${this.api_prefix}/${
|
|
470
|
+
const g = s ? `${e}${this.api_prefix}/${Te}?upload_id=${s}` : `${e}${this.api_prefix}/${Te}`;
|
|
459
471
|
o = await this.fetch(g, {
|
|
460
472
|
method: "POST",
|
|
461
473
|
body: m,
|
|
@@ -490,7 +502,7 @@ async function Pt(e, t, s, n) {
|
|
|
490
502
|
async (o) => {
|
|
491
503
|
if (o.error)
|
|
492
504
|
throw new Error(o.error);
|
|
493
|
-
return o.files ? o.files.map((a, l) => new
|
|
505
|
+
return o.files ? o.files.map((a, l) => new ne({
|
|
494
506
|
...e[l],
|
|
495
507
|
path: a,
|
|
496
508
|
url: `${t}${this.api_prefix}/file=${a}`
|
|
@@ -501,7 +513,7 @@ async function Pt(e, t, s, n) {
|
|
|
501
513
|
}
|
|
502
514
|
async function cs(e, t) {
|
|
503
515
|
return e.map(
|
|
504
|
-
(s) => new
|
|
516
|
+
(s) => new ne({
|
|
505
517
|
path: s.name,
|
|
506
518
|
orig_name: s.name,
|
|
507
519
|
blob: s,
|
|
@@ -511,7 +523,7 @@ async function cs(e, t) {
|
|
|
511
523
|
})
|
|
512
524
|
);
|
|
513
525
|
}
|
|
514
|
-
class
|
|
526
|
+
class ne {
|
|
515
527
|
constructor({
|
|
516
528
|
path: t,
|
|
517
529
|
url: s,
|
|
@@ -536,7 +548,7 @@ class se {
|
|
|
536
548
|
this.path = t, this.url = s, this.orig_name = n, this.size = i, this.blob = s ? void 0 : r, this.is_stream = o, this.mime_type = a, this.alt_text = l, this.b64 = h;
|
|
537
549
|
}
|
|
538
550
|
}
|
|
539
|
-
class
|
|
551
|
+
class Ge {
|
|
540
552
|
constructor(t, s) {
|
|
541
553
|
u(this, "type");
|
|
542
554
|
u(this, "command");
|
|
@@ -546,7 +558,7 @@ class Fe {
|
|
|
546
558
|
}
|
|
547
559
|
}
|
|
548
560
|
const jt = typeof process < "u" && process.versions && process.versions.node;
|
|
549
|
-
function
|
|
561
|
+
function Ae(e, t, s) {
|
|
550
562
|
for (; s.length > 1; ) {
|
|
551
563
|
const i = s.shift();
|
|
552
564
|
if (typeof i == "string" || typeof i == "number")
|
|
@@ -560,7 +572,7 @@ function De(e, t, s) {
|
|
|
560
572
|
else
|
|
561
573
|
throw new Error("Invalid key type");
|
|
562
574
|
}
|
|
563
|
-
async function
|
|
575
|
+
async function me(e, t = void 0, s = [], n = !1, i = void 0) {
|
|
564
576
|
if (Array.isArray(e)) {
|
|
565
577
|
let r = [];
|
|
566
578
|
return await Promise.all(
|
|
@@ -568,7 +580,7 @@ async function de(e, t = void 0, s = [], n = !1, i = void 0) {
|
|
|
568
580
|
var m;
|
|
569
581
|
let l = s.slice();
|
|
570
582
|
l.push(String(a));
|
|
571
|
-
const h = await
|
|
583
|
+
const h = await me(
|
|
572
584
|
e[a],
|
|
573
585
|
n ? ((m = i == null ? void 0 : i.parameters[a]) == null ? void 0 : m.component) || void 0 : t,
|
|
574
586
|
l,
|
|
@@ -592,7 +604,7 @@ async function de(e, t = void 0, s = [], n = !1, i = void 0) {
|
|
|
592
604
|
for (const o of Object.keys(e)) {
|
|
593
605
|
const a = [...s, o], l = e[o];
|
|
594
606
|
r = r.concat(
|
|
595
|
-
await
|
|
607
|
+
await me(
|
|
596
608
|
l,
|
|
597
609
|
void 0,
|
|
598
610
|
a,
|
|
@@ -629,7 +641,7 @@ function ls(e) {
|
|
|
629
641
|
meta: { _type: "gradio.FileData" }
|
|
630
642
|
};
|
|
631
643
|
if (jt)
|
|
632
|
-
return new
|
|
644
|
+
return new Ge("upload_file", {
|
|
633
645
|
path: e,
|
|
634
646
|
name: e,
|
|
635
647
|
orig_path: e
|
|
@@ -677,7 +689,7 @@ function K(e, t, s, n, i = !1) {
|
|
|
677
689
|
async function Ut(e, t, s) {
|
|
678
690
|
const n = this;
|
|
679
691
|
await qt(n, t);
|
|
680
|
-
const i = await
|
|
692
|
+
const i = await me(
|
|
681
693
|
t,
|
|
682
694
|
void 0,
|
|
683
695
|
[],
|
|
@@ -697,46 +709,46 @@ async function Ut(e, t, s) {
|
|
|
697
709
|
})
|
|
698
710
|
)).forEach(({ path: o, file_url: a, type: l, name: h }) => {
|
|
699
711
|
if (l === "Gallery")
|
|
700
|
-
|
|
712
|
+
Ae(t, a, o);
|
|
701
713
|
else if (a) {
|
|
702
|
-
const m = new
|
|
703
|
-
|
|
714
|
+
const m = new ne({ path: a, orig_name: h });
|
|
715
|
+
Ae(t, m, o);
|
|
704
716
|
}
|
|
705
717
|
}), t;
|
|
706
718
|
}
|
|
707
719
|
async function qt(e, t) {
|
|
708
720
|
var n, i;
|
|
709
721
|
if (!(((n = e.config) == null ? void 0 : n.root) || ((i = e.config) == null ? void 0 : i.root_url)))
|
|
710
|
-
throw new Error(
|
|
711
|
-
await
|
|
722
|
+
throw new Error(ze);
|
|
723
|
+
await Me(e, t);
|
|
712
724
|
}
|
|
713
|
-
async function
|
|
725
|
+
async function Me(e, t, s = []) {
|
|
714
726
|
for (const n in t)
|
|
715
|
-
t[n] instanceof
|
|
727
|
+
t[n] instanceof Ge ? await zt(e, t, n) : typeof t[n] == "object" && t[n] !== null && await Me(e, t[n], [...s, n]);
|
|
716
728
|
}
|
|
717
729
|
async function zt(e, t, s) {
|
|
718
730
|
var r, o;
|
|
719
731
|
let n = t[s];
|
|
720
732
|
const i = ((r = e.config) == null ? void 0 : r.root) || ((o = e.config) == null ? void 0 : o.root_url);
|
|
721
733
|
if (!i)
|
|
722
|
-
throw new Error(
|
|
734
|
+
throw new Error(ze);
|
|
723
735
|
try {
|
|
724
736
|
let a, l;
|
|
725
737
|
if (typeof process < "u" && process.versions && process.versions.node) {
|
|
726
738
|
const g = await import("./__vite-browser-external-DYxpcVy9.js");
|
|
727
739
|
l = (await import("./__vite-browser-external-DYxpcVy9.js")).resolve(process.cwd(), n.meta.path), a = await g.readFile(l);
|
|
728
740
|
} else
|
|
729
|
-
throw new Error(
|
|
741
|
+
throw new Error(vt);
|
|
730
742
|
const h = new Blob([a], { type: "application/octet-stream" }), m = await e.upload_files(i, [h]), p = m.files && m.files[0];
|
|
731
743
|
if (p) {
|
|
732
|
-
const g = new
|
|
744
|
+
const g = new ne({
|
|
733
745
|
path: p,
|
|
734
746
|
orig_name: n.meta.name || ""
|
|
735
747
|
});
|
|
736
748
|
t[s] = g;
|
|
737
749
|
}
|
|
738
750
|
} catch (a) {
|
|
739
|
-
console.error(
|
|
751
|
+
console.error(Et, a);
|
|
740
752
|
}
|
|
741
753
|
}
|
|
742
754
|
async function Bt(e, t, s) {
|
|
@@ -789,7 +801,7 @@ async function Q(e, t, s) {
|
|
|
789
801
|
s({
|
|
790
802
|
status: "error",
|
|
791
803
|
load_status: "error",
|
|
792
|
-
message:
|
|
804
|
+
message: mt,
|
|
793
805
|
detail: "NOT_FOUND"
|
|
794
806
|
});
|
|
795
807
|
return;
|
|
@@ -817,7 +829,7 @@ async function Q(e, t, s) {
|
|
|
817
829
|
load_status: "error",
|
|
818
830
|
message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",
|
|
819
831
|
detail: o,
|
|
820
|
-
discussions_enabled: await
|
|
832
|
+
discussions_enabled: await Le(a)
|
|
821
833
|
});
|
|
822
834
|
break;
|
|
823
835
|
case "RUNNING":
|
|
@@ -855,27 +867,27 @@ async function Q(e, t, s) {
|
|
|
855
867
|
load_status: "error",
|
|
856
868
|
message: "This space is experiencing an issue.",
|
|
857
869
|
detail: o,
|
|
858
|
-
discussions_enabled: await
|
|
870
|
+
discussions_enabled: await Le(a)
|
|
859
871
|
});
|
|
860
872
|
break;
|
|
861
873
|
}
|
|
862
874
|
}
|
|
863
|
-
const
|
|
875
|
+
const Je = async (e, t) => {
|
|
864
876
|
let s = 0;
|
|
865
877
|
const n = 12, i = 5e3;
|
|
866
878
|
return new Promise((r) => {
|
|
867
879
|
Q(
|
|
868
880
|
e,
|
|
869
|
-
|
|
881
|
+
we.test(e) ? "space_name" : "subdomain",
|
|
870
882
|
(o) => {
|
|
871
883
|
t(o), o.status === "running" || o.status === "error" || o.status === "paused" || o.status === "space_error" ? r() : (o.status === "sleeping" || o.status === "building") && (s < n ? (s++, setTimeout(() => {
|
|
872
|
-
|
|
884
|
+
Je(e, t).then(r);
|
|
873
885
|
}, i)) : r());
|
|
874
886
|
}
|
|
875
887
|
);
|
|
876
888
|
});
|
|
877
889
|
}, Gt = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;
|
|
878
|
-
async function
|
|
890
|
+
async function Le(e) {
|
|
879
891
|
try {
|
|
880
892
|
const t = await fetch(
|
|
881
893
|
`https://huggingface.co/api/spaces/${e}/discussions`,
|
|
@@ -893,7 +905,7 @@ async function Mt(e, t) {
|
|
|
893
905
|
t && (s.Authorization = `Bearer ${t}`);
|
|
894
906
|
try {
|
|
895
907
|
const n = await fetch(
|
|
896
|
-
`https://huggingface.co/api/spaces/${e}/${
|
|
908
|
+
`https://huggingface.co/api/spaces/${e}/${ct}`,
|
|
897
909
|
{ headers: s }
|
|
898
910
|
);
|
|
899
911
|
if (n.status !== 200)
|
|
@@ -912,7 +924,7 @@ async function Jt(e, t, s) {
|
|
|
912
924
|
};
|
|
913
925
|
try {
|
|
914
926
|
const r = await fetch(
|
|
915
|
-
`https://huggingface.co/api/spaces/${e}/${
|
|
927
|
+
`https://huggingface.co/api/spaces/${e}/${lt}`,
|
|
916
928
|
{
|
|
917
929
|
method: "POST",
|
|
918
930
|
headers: { "Content-Type": "application/json", ...n },
|
|
@@ -928,7 +940,7 @@ async function Jt(e, t, s) {
|
|
|
928
940
|
throw new Error(r.message);
|
|
929
941
|
}
|
|
930
942
|
}
|
|
931
|
-
const
|
|
943
|
+
const Pe = [
|
|
932
944
|
"cpu-basic",
|
|
933
945
|
"cpu-upgrade",
|
|
934
946
|
"cpu-xl",
|
|
@@ -945,23 +957,23 @@ const Ae = [
|
|
|
945
957
|
];
|
|
946
958
|
async function Wt(e, t) {
|
|
947
959
|
const { hf_token: s, private: n, hardware: i, timeout: r, auth: o } = t;
|
|
948
|
-
if (i && !
|
|
960
|
+
if (i && !Pe.includes(i))
|
|
949
961
|
throw new Error(
|
|
950
|
-
`Invalid hardware type provided. Valid types are: ${
|
|
962
|
+
`Invalid hardware type provided. Valid types are: ${Pe.map((_) => `"${_}"`).join(",")}.`
|
|
951
963
|
);
|
|
952
|
-
const { http_protocol: a, host: l } = await
|
|
964
|
+
const { http_protocol: a, host: l } = await se(
|
|
953
965
|
e,
|
|
954
966
|
s
|
|
955
967
|
);
|
|
956
968
|
let h = null;
|
|
957
969
|
if (o) {
|
|
958
|
-
const _ = await
|
|
970
|
+
const _ = await Be(
|
|
959
971
|
a,
|
|
960
972
|
l,
|
|
961
973
|
o,
|
|
962
974
|
fetch
|
|
963
975
|
);
|
|
964
|
-
_ && (h =
|
|
976
|
+
_ && (h = Fe(_));
|
|
965
977
|
}
|
|
966
978
|
const m = {
|
|
967
979
|
Authorization: `Bearer ${s}`,
|
|
@@ -977,7 +989,7 @@ async function Wt(e, t) {
|
|
|
977
989
|
try {
|
|
978
990
|
i || (B = await Mt(e, s));
|
|
979
991
|
} catch (_) {
|
|
980
|
-
throw Error(
|
|
992
|
+
throw Error(ge + _.message);
|
|
981
993
|
}
|
|
982
994
|
const c = i || B || "cpu-basic";
|
|
983
995
|
E.hardware = c;
|
|
@@ -992,14 +1004,14 @@ async function Wt(e, t) {
|
|
|
992
1004
|
);
|
|
993
1005
|
if (_.status === 409)
|
|
994
1006
|
try {
|
|
995
|
-
return await
|
|
1007
|
+
return await te.connect(`${p}/${g}`, t);
|
|
996
1008
|
} catch (C) {
|
|
997
1009
|
throw console.error("Failed to connect Client instance:", C), C;
|
|
998
1010
|
}
|
|
999
1011
|
else if (_.status !== 200)
|
|
1000
1012
|
throw new Error(_.statusText);
|
|
1001
1013
|
const N = await _.json();
|
|
1002
|
-
return await Jt(`${p}/${g}`, r || 300, s), await
|
|
1014
|
+
return await Jt(`${p}/${g}`, r || 300, s), await te.connect(
|
|
1003
1015
|
Ht(N.url),
|
|
1004
1016
|
t
|
|
1005
1017
|
);
|
|
@@ -1030,7 +1042,7 @@ class Vt extends TransformStream {
|
|
|
1030
1042
|
const a = n[r - 1] === "\r" ? r - 1 : r;
|
|
1031
1043
|
i.enqueue(n.slice(0, a)), n = n.slice(r + 1);
|
|
1032
1044
|
}
|
|
1033
|
-
|
|
1045
|
+
Ne(this, I, n);
|
|
1034
1046
|
},
|
|
1035
1047
|
flush: (n) => {
|
|
1036
1048
|
if (W(this, I) === "")
|
|
@@ -1039,7 +1051,7 @@ class Vt extends TransformStream {
|
|
|
1039
1051
|
n.enqueue(i);
|
|
1040
1052
|
}
|
|
1041
1053
|
});
|
|
1042
|
-
|
|
1054
|
+
Oe(this, I, "");
|
|
1043
1055
|
}
|
|
1044
1056
|
}
|
|
1045
1057
|
I = new WeakMap();
|
|
@@ -1055,7 +1067,7 @@ function Kt(e) {
|
|
|
1055
1067
|
e.substring(n + s[0].length)
|
|
1056
1068
|
];
|
|
1057
1069
|
}
|
|
1058
|
-
function
|
|
1070
|
+
function je(e, t, s) {
|
|
1059
1071
|
e.get(t) || e.set(t, s);
|
|
1060
1072
|
}
|
|
1061
1073
|
async function* Qt(e, t) {
|
|
@@ -1078,7 +1090,7 @@ async function* Qt(e, t) {
|
|
|
1078
1090
|
}
|
|
1079
1091
|
async function Xt(e, t) {
|
|
1080
1092
|
let s = new Request(e, t);
|
|
1081
|
-
|
|
1093
|
+
je(s.headers, "Accept", "text/event-stream"), je(s.headers, "Content-Type", "application/json");
|
|
1082
1094
|
let n = await fetch(s);
|
|
1083
1095
|
if (!n.ok)
|
|
1084
1096
|
throw n;
|
|
@@ -1099,7 +1111,7 @@ async function Yt() {
|
|
|
1099
1111
|
n.open = !0;
|
|
1100
1112
|
let a = null, l = new URLSearchParams({
|
|
1101
1113
|
session_hash: this.session_hash
|
|
1102
|
-
}).toString(), h = new URL(`${i.root}${this.api_prefix}/${
|
|
1114
|
+
}).toString(), h = new URL(`${i.root}${this.api_prefix}/${Ie}?${l}`);
|
|
1103
1115
|
if (r && h.searchParams.set("__sign", r), a = this.stream(h), !a) {
|
|
1104
1116
|
console.warn("Cannot connect to SSE endpoint: " + h.toString());
|
|
1105
1117
|
return;
|
|
@@ -1107,7 +1119,7 @@ async function Yt() {
|
|
|
1107
1119
|
a.onmessage = async function(m) {
|
|
1108
1120
|
let p = JSON.parse(m.data);
|
|
1109
1121
|
if (p.msg === "close_stream") {
|
|
1110
|
-
|
|
1122
|
+
ye(n, o.abort_controller);
|
|
1111
1123
|
return;
|
|
1112
1124
|
}
|
|
1113
1125
|
const g = p.event_id;
|
|
@@ -1136,7 +1148,7 @@ async function Yt() {
|
|
|
1136
1148
|
);
|
|
1137
1149
|
};
|
|
1138
1150
|
}
|
|
1139
|
-
function
|
|
1151
|
+
function ye(e, t) {
|
|
1140
1152
|
e && (e.open = !1, t == null || t.abort());
|
|
1141
1153
|
}
|
|
1142
1154
|
function es(e, t, s) {
|
|
@@ -1223,21 +1235,21 @@ function is(e, t = {}, s, n, i) {
|
|
|
1223
1235
|
var r;
|
|
1224
1236
|
try {
|
|
1225
1237
|
let o = function(w) {
|
|
1226
|
-
(i ||
|
|
1238
|
+
(i || Ke[w.type]) && m(w);
|
|
1227
1239
|
}, a = function() {
|
|
1228
|
-
for (
|
|
1240
|
+
for (Ye = !0; Z.length > 0; )
|
|
1229
1241
|
Z.shift()({
|
|
1230
1242
|
value: void 0,
|
|
1231
1243
|
done: !0
|
|
1232
1244
|
});
|
|
1233
1245
|
}, l = function(w) {
|
|
1234
|
-
Z.length > 0 ? Z.shift()(w) :
|
|
1246
|
+
Z.length > 0 ? Z.shift()(w) : ue.push(w);
|
|
1235
1247
|
}, h = function(w) {
|
|
1236
1248
|
l(os(w)), a();
|
|
1237
1249
|
}, m = function(w) {
|
|
1238
1250
|
l({ value: w, done: !1 });
|
|
1239
1251
|
}, p = function() {
|
|
1240
|
-
return
|
|
1252
|
+
return ue.length > 0 ? Promise.resolve(ue.shift()) : new Promise((w) => Z.push(w));
|
|
1241
1253
|
};
|
|
1242
1254
|
const { hf_token: g } = this.options, {
|
|
1243
1255
|
fetch: E,
|
|
@@ -1246,30 +1258,30 @@ function is(e, t = {}, s, n, i) {
|
|
|
1246
1258
|
session_hash: _,
|
|
1247
1259
|
api_info: N,
|
|
1248
1260
|
api_map: C,
|
|
1249
|
-
stream_status:
|
|
1250
|
-
pending_stream_messages:
|
|
1251
|
-
pending_diff_streams:
|
|
1252
|
-
event_callbacks:
|
|
1253
|
-
unclosed_events:
|
|
1254
|
-
post_data:
|
|
1261
|
+
stream_status: ie,
|
|
1262
|
+
pending_stream_messages: oe,
|
|
1263
|
+
pending_diff_streams: re,
|
|
1264
|
+
event_callbacks: ae,
|
|
1265
|
+
unclosed_events: We,
|
|
1266
|
+
post_data: ce,
|
|
1255
1267
|
options: F,
|
|
1256
1268
|
api_prefix: M
|
|
1257
|
-
} = this,
|
|
1269
|
+
} = this, He = this;
|
|
1258
1270
|
if (!N) throw new Error("No API found");
|
|
1259
1271
|
if (!c) throw new Error("Could not resolve app config");
|
|
1260
|
-
let { fn_index: f, endpoint_info:
|
|
1272
|
+
let { fn_index: f, endpoint_info: be, dependency: J } = rs(
|
|
1261
1273
|
N,
|
|
1262
1274
|
e,
|
|
1263
1275
|
C,
|
|
1264
1276
|
c
|
|
1265
|
-
),
|
|
1277
|
+
), Ve = Ct(t, be), R, T, j = c.protocol ?? "ws", ve = "", Ze = () => ve;
|
|
1266
1278
|
const d = typeof e == "number" ? "/predict" : e;
|
|
1267
|
-
let V, S = null, D = !1,
|
|
1268
|
-
const
|
|
1279
|
+
let V, S = null, D = !1, le = {}, G = typeof window < "u" && typeof document < "u" ? new URLSearchParams(window.location.search).toString() : "";
|
|
1280
|
+
const Ke = ((r = F == null ? void 0 : F.events) == null ? void 0 : r.reduce(
|
|
1269
1281
|
(w, x) => (w[x] = !0, w),
|
|
1270
1282
|
{}
|
|
1271
1283
|
)) || {};
|
|
1272
|
-
async function
|
|
1284
|
+
async function Qe() {
|
|
1273
1285
|
let w = {}, x = {};
|
|
1274
1286
|
j === "ws" ? (R && R.readyState === 0 ? R.addEventListener("open", () => {
|
|
1275
1287
|
R.close();
|
|
@@ -1277,11 +1289,11 @@ function is(e, t = {}, s, n, i) {
|
|
|
1277
1289
|
try {
|
|
1278
1290
|
if (!c)
|
|
1279
1291
|
throw new Error("Could not resolve app config");
|
|
1280
|
-
"event_id" in x && await E(`${c.root}${M}/${
|
|
1292
|
+
"event_id" in x && await E(`${c.root}${M}/${ht}`, {
|
|
1281
1293
|
headers: { "Content-Type": "application/json" },
|
|
1282
1294
|
method: "POST",
|
|
1283
1295
|
body: JSON.stringify(x)
|
|
1284
|
-
}), await E(`${c.root}${M}/${
|
|
1296
|
+
}), await E(`${c.root}${M}/${ft}`, {
|
|
1285
1297
|
headers: { "Content-Type": "application/json" },
|
|
1286
1298
|
method: "POST",
|
|
1287
1299
|
body: JSON.stringify(w)
|
|
@@ -1292,10 +1304,10 @@ function is(e, t = {}, s, n, i) {
|
|
|
1292
1304
|
);
|
|
1293
1305
|
}
|
|
1294
1306
|
}
|
|
1295
|
-
const
|
|
1307
|
+
const Xe = async (w) => {
|
|
1296
1308
|
await this._resolve_heartbeat(w);
|
|
1297
1309
|
};
|
|
1298
|
-
async function
|
|
1310
|
+
async function Ee(w) {
|
|
1299
1311
|
if (!c) return;
|
|
1300
1312
|
let x = w.render_id;
|
|
1301
1313
|
c.components = [
|
|
@@ -1308,14 +1320,14 @@ function is(e, t = {}, s, n, i) {
|
|
|
1308
1320
|
const X = c.components.some((y) => y.type === "state"), Y = c.dependencies.some(
|
|
1309
1321
|
(y) => y.targets.some((U) => U[1] === "unload")
|
|
1310
1322
|
);
|
|
1311
|
-
c.connect_heartbeat = X || Y, await
|
|
1323
|
+
c.connect_heartbeat = X || Y, await Xe(c), o({
|
|
1312
1324
|
type: "render",
|
|
1313
1325
|
data: w,
|
|
1314
1326
|
endpoint: d,
|
|
1315
1327
|
fn_index: f
|
|
1316
1328
|
});
|
|
1317
1329
|
}
|
|
1318
|
-
this.handle_blob(c.root,
|
|
1330
|
+
this.handle_blob(c.root, Ve, be).then(
|
|
1319
1331
|
async (w) => {
|
|
1320
1332
|
var Y;
|
|
1321
1333
|
if (V = {
|
|
@@ -1337,7 +1349,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1337
1349
|
queue: !1,
|
|
1338
1350
|
fn_index: f,
|
|
1339
1351
|
time: /* @__PURE__ */ new Date()
|
|
1340
|
-
}),
|
|
1352
|
+
}), ce(
|
|
1341
1353
|
`${c.root}${M}/run${d.startsWith("/") ? d : `/${d}`}${G ? "?" + G : ""}`,
|
|
1342
1354
|
{
|
|
1343
1355
|
...V,
|
|
@@ -1359,7 +1371,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1359
1371
|
time: /* @__PURE__ */ new Date(),
|
|
1360
1372
|
event_data: s,
|
|
1361
1373
|
trigger_id: n
|
|
1362
|
-
}), y.render_config &&
|
|
1374
|
+
}), y.render_config && Ee(y.render_config), o({
|
|
1363
1375
|
type: "status",
|
|
1364
1376
|
endpoint: d,
|
|
1365
1377
|
fn_index: f,
|
|
@@ -1388,7 +1400,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1388
1400
|
});
|
|
1389
1401
|
});
|
|
1390
1402
|
else if (j == "ws") {
|
|
1391
|
-
const { ws_protocol: y, host: U } = await
|
|
1403
|
+
const { ws_protocol: y, host: U } = await se(
|
|
1392
1404
|
B,
|
|
1393
1405
|
g
|
|
1394
1406
|
);
|
|
@@ -1401,7 +1413,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1401
1413
|
time: /* @__PURE__ */ new Date()
|
|
1402
1414
|
});
|
|
1403
1415
|
let q = new URL(
|
|
1404
|
-
`${y}://${
|
|
1416
|
+
`${y}://${St(
|
|
1405
1417
|
U,
|
|
1406
1418
|
c.root,
|
|
1407
1419
|
!0
|
|
@@ -1419,9 +1431,9 @@ function is(e, t = {}, s, n, i) {
|
|
|
1419
1431
|
time: /* @__PURE__ */ new Date()
|
|
1420
1432
|
});
|
|
1421
1433
|
}, R.onmessage = function(A) {
|
|
1422
|
-
const k = JSON.parse(A.data), { type: $, status: v, data: O } =
|
|
1434
|
+
const k = JSON.parse(A.data), { type: $, status: v, data: O } = de(
|
|
1423
1435
|
k,
|
|
1424
|
-
|
|
1436
|
+
le[f]
|
|
1425
1437
|
);
|
|
1426
1438
|
if ($ === "update" && v && !D)
|
|
1427
1439
|
o({
|
|
@@ -1475,7 +1487,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1475
1487
|
endpoint: d,
|
|
1476
1488
|
fn_index: f
|
|
1477
1489
|
}), R.close()));
|
|
1478
|
-
},
|
|
1490
|
+
}, xe(c.version || "2.0.0", "3.6") < 0 && addEventListener(
|
|
1479
1491
|
"open",
|
|
1480
1492
|
() => R.send(JSON.stringify({ hash: _ }))
|
|
1481
1493
|
);
|
|
@@ -1493,16 +1505,16 @@ function is(e, t = {}, s, n, i) {
|
|
|
1493
1505
|
session_hash: _
|
|
1494
1506
|
}).toString();
|
|
1495
1507
|
let y = new URL(
|
|
1496
|
-
`${c.root}${M}/${
|
|
1508
|
+
`${c.root}${M}/${Ie}?${G ? G + "&" : ""}${X}`
|
|
1497
1509
|
);
|
|
1498
1510
|
if (this.jwt && y.searchParams.set("__sign", this.jwt), T = this.stream(y), !T)
|
|
1499
1511
|
return Promise.reject(
|
|
1500
1512
|
new Error("Cannot connect to SSE endpoint: " + y.toString())
|
|
1501
1513
|
);
|
|
1502
1514
|
T.onmessage = async function(U) {
|
|
1503
|
-
const q = JSON.parse(U.data), { type: A, status: k, data: $ } =
|
|
1515
|
+
const q = JSON.parse(U.data), { type: A, status: k, data: $ } = de(
|
|
1504
1516
|
q,
|
|
1505
|
-
|
|
1517
|
+
le[f]
|
|
1506
1518
|
);
|
|
1507
1519
|
if (A === "update" && k && !D)
|
|
1508
1520
|
o({
|
|
@@ -1513,7 +1525,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1513
1525
|
...k
|
|
1514
1526
|
}), k.stage === "error" && (T == null || T.close(), a());
|
|
1515
1527
|
else if (A === "data") {
|
|
1516
|
-
let [v, O] = await
|
|
1528
|
+
let [v, O] = await ce(
|
|
1517
1529
|
`${c.root}${M}/queue/data`,
|
|
1518
1530
|
{
|
|
1519
1531
|
...V,
|
|
@@ -1584,8 +1596,8 @@ function is(e, t = {}, s, n, i) {
|
|
|
1584
1596
|
let y = "";
|
|
1585
1597
|
typeof window < "u" && typeof document < "u" && (y = (Y = window == null ? void 0 : window.location) == null ? void 0 : Y.hostname);
|
|
1586
1598
|
const q = y.includes(".dev.") ? `https://moon-${y.split(".")[1]}.dev.spaces.huggingface.tech` : "https://huggingface.co";
|
|
1587
|
-
(typeof window < "u" && typeof document < "u" && window.parent != window && window.supports_zerogpu_headers ? It("zerogpu-headers", q) : Promise.resolve(null)).then((v) =>
|
|
1588
|
-
`${c.root}${M}/${
|
|
1599
|
+
(typeof window < "u" && typeof document < "u" && window.parent != window && window.supports_zerogpu_headers ? It("zerogpu-headers", q) : Promise.resolve(null)).then((v) => ce(
|
|
1600
|
+
`${c.root}${M}/${ot}?${G}`,
|
|
1589
1601
|
{
|
|
1590
1602
|
...V,
|
|
1591
1603
|
session_hash: _
|
|
@@ -1596,7 +1608,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1596
1608
|
o({
|
|
1597
1609
|
type: "status",
|
|
1598
1610
|
stage: "error",
|
|
1599
|
-
message:
|
|
1611
|
+
message: Ue,
|
|
1600
1612
|
queue: !0,
|
|
1601
1613
|
endpoint: d,
|
|
1602
1614
|
fn_index: f,
|
|
@@ -1625,12 +1637,12 @@ function is(e, t = {}, s, n, i) {
|
|
|
1625
1637
|
time: /* @__PURE__ */ new Date()
|
|
1626
1638
|
});
|
|
1627
1639
|
else {
|
|
1628
|
-
S = v.event_id,
|
|
1629
|
-
let
|
|
1640
|
+
S = v.event_id, ve = S;
|
|
1641
|
+
let $e = async function(pe) {
|
|
1630
1642
|
try {
|
|
1631
|
-
const { type: L, status: b, data: P, original_msg:
|
|
1632
|
-
|
|
1633
|
-
|
|
1643
|
+
const { type: L, status: b, data: P, original_msg: et } = de(
|
|
1644
|
+
pe,
|
|
1645
|
+
le[f]
|
|
1634
1646
|
);
|
|
1635
1647
|
if (L == "heartbeat")
|
|
1636
1648
|
return;
|
|
@@ -1640,21 +1652,21 @@ function is(e, t = {}, s, n, i) {
|
|
|
1640
1652
|
endpoint: d,
|
|
1641
1653
|
fn_index: f,
|
|
1642
1654
|
time: /* @__PURE__ */ new Date(),
|
|
1643
|
-
original_msg:
|
|
1655
|
+
original_msg: et,
|
|
1644
1656
|
...b
|
|
1645
1657
|
});
|
|
1646
1658
|
else if (L === "complete")
|
|
1647
1659
|
D = b;
|
|
1648
1660
|
else if (L == "unexpected_error" || L == "broken_connection") {
|
|
1649
1661
|
console.error("Unexpected error", b == null ? void 0 : b.message);
|
|
1650
|
-
const
|
|
1662
|
+
const tt = L === "broken_connection";
|
|
1651
1663
|
o({
|
|
1652
1664
|
type: "status",
|
|
1653
1665
|
stage: "error",
|
|
1654
1666
|
message: (b == null ? void 0 : b.message) || "An Unexpected Error Occurred!",
|
|
1655
1667
|
queue: !0,
|
|
1656
1668
|
endpoint: d,
|
|
1657
|
-
broken:
|
|
1669
|
+
broken: tt,
|
|
1658
1670
|
session_not_found: b == null ? void 0 : b.session_not_found,
|
|
1659
1671
|
fn_index: f,
|
|
1660
1672
|
time: /* @__PURE__ */ new Date()
|
|
@@ -1679,7 +1691,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1679
1691
|
queue: !0,
|
|
1680
1692
|
endpoint: d,
|
|
1681
1693
|
fn_index: f
|
|
1682
|
-
}), P && J.connection !== "stream" && ["sse_v2", "sse_v2.1", "sse_v3"].includes(j) && es(
|
|
1694
|
+
}), P && J.connection !== "stream" && ["sse_v2", "sse_v2.1", "sse_v3"].includes(j) && es(re, S, P));
|
|
1683
1695
|
P && (o({
|
|
1684
1696
|
type: "data",
|
|
1685
1697
|
time: /* @__PURE__ */ new Date(),
|
|
@@ -1692,7 +1704,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1692
1704
|
),
|
|
1693
1705
|
endpoint: d,
|
|
1694
1706
|
fn_index: f
|
|
1695
|
-
}), P.render_config && await
|
|
1707
|
+
}), P.render_config && await Ee(P.render_config), D && (o({
|
|
1696
1708
|
type: "status",
|
|
1697
1709
|
time: /* @__PURE__ */ new Date(),
|
|
1698
1710
|
...D,
|
|
@@ -1700,7 +1712,7 @@ function is(e, t = {}, s, n, i) {
|
|
|
1700
1712
|
queue: !0,
|
|
1701
1713
|
endpoint: d,
|
|
1702
1714
|
fn_index: f
|
|
1703
|
-
}), a())), ((b == null ? void 0 : b.stage) === "complete" || (b == null ? void 0 : b.stage) === "error") && (
|
|
1715
|
+
}), a())), ((b == null ? void 0 : b.stage) === "complete" || (b == null ? void 0 : b.stage) === "error") && (ae[S] && delete ae[S], S in re && delete re[S]);
|
|
1704
1716
|
} catch (L) {
|
|
1705
1717
|
console.error("Unexpected client exception", L), o({
|
|
1706
1718
|
type: "status",
|
|
@@ -1710,27 +1722,27 @@ function is(e, t = {}, s, n, i) {
|
|
|
1710
1722
|
endpoint: d,
|
|
1711
1723
|
fn_index: f,
|
|
1712
1724
|
time: /* @__PURE__ */ new Date()
|
|
1713
|
-
}), ["sse_v2", "sse_v2.1", "sse_v3"].includes(j) && (
|
|
1725
|
+
}), ["sse_v2", "sse_v2.1", "sse_v3"].includes(j) && (ye(ie, He.abort_controller), ie.open = !1, a());
|
|
1714
1726
|
}
|
|
1715
1727
|
};
|
|
1716
|
-
S in
|
|
1717
|
-
(
|
|
1718
|
-
), delete
|
|
1728
|
+
S in oe && (oe[S].forEach(
|
|
1729
|
+
(pe) => $e(pe)
|
|
1730
|
+
), delete oe[S]), ae[S] = $e, We.add(S), ie.open || await this.open_stream();
|
|
1719
1731
|
}
|
|
1720
1732
|
});
|
|
1721
1733
|
}
|
|
1722
1734
|
}
|
|
1723
1735
|
);
|
|
1724
|
-
let
|
|
1725
|
-
const
|
|
1726
|
-
[Symbol.asyncIterator]: () =>
|
|
1736
|
+
let Ye = !1;
|
|
1737
|
+
const ue = [], Z = [], Se = {
|
|
1738
|
+
[Symbol.asyncIterator]: () => Se,
|
|
1727
1739
|
next: p,
|
|
1728
1740
|
throw: async (w) => (h(w), p()),
|
|
1729
1741
|
return: async () => (a(), p()),
|
|
1730
|
-
cancel:
|
|
1731
|
-
event_id:
|
|
1742
|
+
cancel: Qe,
|
|
1743
|
+
event_id: Ze
|
|
1732
1744
|
};
|
|
1733
|
-
return
|
|
1745
|
+
return Se;
|
|
1734
1746
|
} catch (o) {
|
|
1735
1747
|
throw console.error("Submit function encountered an error:", o), o;
|
|
1736
1748
|
}
|
|
@@ -1756,7 +1768,7 @@ function rs(e, t, s, n) {
|
|
|
1756
1768
|
);
|
|
1757
1769
|
return { fn_index: i, endpoint_info: r, dependency: o };
|
|
1758
1770
|
}
|
|
1759
|
-
class
|
|
1771
|
+
class te {
|
|
1760
1772
|
constructor(t, s = { events: ["data"] }) {
|
|
1761
1773
|
u(this, "app_reference");
|
|
1762
1774
|
u(this, "options");
|
|
@@ -1792,7 +1804,7 @@ class ee {
|
|
|
1792
1804
|
u(this, "resolve_config");
|
|
1793
1805
|
u(this, "resolve_cookies");
|
|
1794
1806
|
var n;
|
|
1795
|
-
this.app_reference = t, this.deep_link = ((n = s.query_params) == null ? void 0 : n.deep_link) || null, s.events || (s.events = ["data"]), this.options = s, this.current_payload = {}, this.view_api = At.bind(this), this.upload_files = Lt.bind(this), this.handle_blob = Ut.bind(this), this.post_data = Bt.bind(this), this.submit = is.bind(this), this.predict = Ft.bind(this), this.open_stream = Yt.bind(this), this.resolve_config =
|
|
1807
|
+
this.app_reference = t, this.deep_link = ((n = s.query_params) == null ? void 0 : n.deep_link) || null, s.events || (s.events = ["data"]), this.options = s, this.current_payload = {}, this.view_api = At.bind(this), this.upload_files = Lt.bind(this), this.handle_blob = Ut.bind(this), this.post_data = Bt.bind(this), this.submit = is.bind(this), this.predict = Ft.bind(this), this.open_stream = Yt.bind(this), this.resolve_config = kt.bind(this), this.resolve_cookies = Rt.bind(this), this.upload = Pt.bind(this), this.fetch = this.fetch.bind(this), this.handle_space_success = this.handle_space_success.bind(this), this.stream = this.stream.bind(this);
|
|
1796
1808
|
}
|
|
1797
1809
|
get_url_config(t = null) {
|
|
1798
1810
|
if (!this.config)
|
|
@@ -1840,16 +1852,16 @@ class ee {
|
|
|
1840
1852
|
var t;
|
|
1841
1853
|
this.options.auth && await this.resolve_cookies(), await this._resolve_config().then(
|
|
1842
1854
|
({ config: s }) => this._resolve_heartbeat(s)
|
|
1843
|
-
), this.api_info = await this.view_api(), this.api_map =
|
|
1855
|
+
), this.api_info = await this.view_api(), this.api_map = $t(((t = this.config) == null ? void 0 : t.dependencies) || []);
|
|
1844
1856
|
}
|
|
1845
1857
|
async _resolve_heartbeat(t) {
|
|
1846
|
-
if (t && (this.config = t, this.api_prefix = t.api_prefix || "", this.config && this.config.connect_heartbeat && this.config.space_id && this.options.hf_token && (this.jwt = await
|
|
1858
|
+
if (t && (this.config = t, this.api_prefix = t.api_prefix || "", this.config && this.config.connect_heartbeat && this.config.space_id && this.options.hf_token && (this.jwt = await De(
|
|
1847
1859
|
this.config.space_id,
|
|
1848
1860
|
this.options.hf_token,
|
|
1849
1861
|
this.cookies
|
|
1850
|
-
))), t.space_id && this.options.hf_token && (this.jwt = await
|
|
1862
|
+
))), t.space_id && this.options.hf_token && (this.jwt = await De(t.space_id, this.options.hf_token)), this.config && this.config.connect_heartbeat) {
|
|
1851
1863
|
const s = new URL(
|
|
1852
|
-
`${this.config.root}${this.api_prefix}/${
|
|
1864
|
+
`${this.config.root}${this.api_prefix}/${ut}/${this.session_hash}`
|
|
1853
1865
|
);
|
|
1854
1866
|
this.jwt && s.searchParams.set("__sign", this.jwt), this.heartbeat_event || (this.heartbeat_event = this.stream(s));
|
|
1855
1867
|
}
|
|
@@ -1862,7 +1874,7 @@ class ee {
|
|
|
1862
1874
|
}
|
|
1863
1875
|
async reconnect() {
|
|
1864
1876
|
const t = new URL(
|
|
1865
|
-
`${this.config.root}${this.api_prefix}/${
|
|
1877
|
+
`${this.config.root}${this.api_prefix}/${dt}`
|
|
1866
1878
|
);
|
|
1867
1879
|
let s;
|
|
1868
1880
|
try {
|
|
@@ -1876,7 +1888,7 @@ class ee {
|
|
|
1876
1888
|
return s !== this.config.app_id ? "changed" : "connected";
|
|
1877
1889
|
}
|
|
1878
1890
|
close() {
|
|
1879
|
-
this.closed = !0,
|
|
1891
|
+
this.closed = !0, ye(this.stream_status, this.abort_controller);
|
|
1880
1892
|
}
|
|
1881
1893
|
set_current_payload(t) {
|
|
1882
1894
|
this.current_payload = t;
|
|
@@ -1887,11 +1899,11 @@ class ee {
|
|
|
1887
1899
|
return Wt(t, s);
|
|
1888
1900
|
}
|
|
1889
1901
|
async _resolve_config() {
|
|
1890
|
-
const { http_protocol: t, host: s, space_id: n } = await
|
|
1902
|
+
const { http_protocol: t, host: s, space_id: n } = await se(
|
|
1891
1903
|
this.app_reference,
|
|
1892
1904
|
this.options.hf_token
|
|
1893
1905
|
), { status_callback: i } = this.options;
|
|
1894
|
-
n && i && await
|
|
1906
|
+
n && i && await Je(n, i);
|
|
1895
1907
|
let r;
|
|
1896
1908
|
try {
|
|
1897
1909
|
let o = `${t}//${s}`;
|
|
@@ -1902,7 +1914,7 @@ class ee {
|
|
|
1902
1914
|
if (n && i)
|
|
1903
1915
|
Q(
|
|
1904
1916
|
n,
|
|
1905
|
-
|
|
1917
|
+
we.test(n) ? "space_name" : "subdomain",
|
|
1906
1918
|
this.handle_space_success
|
|
1907
1919
|
);
|
|
1908
1920
|
else
|
|
@@ -1920,7 +1932,7 @@ class ee {
|
|
|
1920
1932
|
try {
|
|
1921
1933
|
this.api_info = await this.view_api();
|
|
1922
1934
|
} catch (s) {
|
|
1923
|
-
console.error(
|
|
1935
|
+
console.error(gt + s.message);
|
|
1924
1936
|
}
|
|
1925
1937
|
return this.prepare_return_obj();
|
|
1926
1938
|
}
|
|
@@ -1969,7 +1981,7 @@ class ee {
|
|
|
1969
1981
|
r && (i.Authorization = `Bearer ${r}`);
|
|
1970
1982
|
try {
|
|
1971
1983
|
const p = await this.fetch(
|
|
1972
|
-
`${a}${this.api_prefix}/${
|
|
1984
|
+
`${a}${this.api_prefix}/${pt}/`,
|
|
1973
1985
|
{
|
|
1974
1986
|
method: "POST",
|
|
1975
1987
|
body: h,
|
|
@@ -1987,7 +1999,7 @@ class ee {
|
|
|
1987
1999
|
}
|
|
1988
2000
|
}
|
|
1989
2001
|
set_cookies(t) {
|
|
1990
|
-
this.cookies =
|
|
2002
|
+
this.cookies = Fe(t).join("; ");
|
|
1991
2003
|
}
|
|
1992
2004
|
prepare_return_obj() {
|
|
1993
2005
|
return {
|
|
@@ -2035,15 +2047,15 @@ class ee {
|
|
|
2035
2047
|
async function us(e, t = {
|
|
2036
2048
|
events: ["data"]
|
|
2037
2049
|
}) {
|
|
2038
|
-
return await
|
|
2050
|
+
return await te.connect(e, t);
|
|
2039
2051
|
}
|
|
2040
2052
|
async function ps(e, t) {
|
|
2041
|
-
return await
|
|
2053
|
+
return await te.duplicate(e, t);
|
|
2042
2054
|
}
|
|
2043
2055
|
export {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2056
|
+
te as Client,
|
|
2057
|
+
ne as FileData,
|
|
2058
|
+
bt as MISSING_CREDENTIALS_MSG,
|
|
2047
2059
|
us as client,
|
|
2048
2060
|
ps as duplicate,
|
|
2049
2061
|
ls as handle_file,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init_helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/init_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUvC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAG5B;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,OAAO,GACtB,MAAM,CAKR;AAED,wBAAsB,OAAO,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,MAAM,EAAE,EACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAezB;AAED,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,wBAAsB,cAAc,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"init_helpers.d.ts","sourceRoot":"","sources":["../../src/helpers/init_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUvC,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAG5B;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,OAAO,GACtB,MAAM,CAKR;AAED,wBAAsB,OAAO,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,MAAM,EAAE,EACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,CAezB;AAED,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,CAAC,cAAc,CAAC,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,wBAAsB,cAAc,CACnC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAuD7B;AA+BD,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBjE;AAGD,wBAAsB,iBAAiB,CACtC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,MAAM,EAAE,OAAO,KAAK,EACpB,QAAQ,CAAC,EAAE,MAAM,MAAM,EAAE,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyBxB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACrD,WAAW,EAAE,IAAI,GAAG,KAAK,CAAC;IAC1B,aAAa,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CACb,CAkBA;AAED,eAAO,MAAM,qBAAqB,kBAAmB,MAAM,KAAG,MAAM,EAUnE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -73,10 +73,29 @@ function map_names_to_ids(fns) {
|
|
|
73
73
|
async function resolve_config(endpoint) {
|
|
74
74
|
const headers = this.options.hf_token ? { Authorization: `Bearer ${this.options.hf_token}` } : {};
|
|
75
75
|
headers["Content-Type"] = "application/json";
|
|
76
|
-
if (typeof window !== "undefined" && window.gradio_config && location.origin !== "http://localhost:9876"
|
|
76
|
+
if (typeof window !== "undefined" && window.gradio_config && location.origin !== "http://localhost:9876") {
|
|
77
77
|
if (window.gradio_config.current_page) {
|
|
78
78
|
endpoint = endpoint.substring(0, endpoint.lastIndexOf("/"));
|
|
79
79
|
}
|
|
80
|
+
if (window.gradio_config.dev_mode) {
|
|
81
|
+
let config_url = join_urls(
|
|
82
|
+
endpoint,
|
|
83
|
+
this.deep_link ? CONFIG_URL + "?deep_link=" + this.deep_link : CONFIG_URL
|
|
84
|
+
);
|
|
85
|
+
const response = await this.fetch(config_url, {
|
|
86
|
+
headers,
|
|
87
|
+
credentials: "include"
|
|
88
|
+
});
|
|
89
|
+
const config = await handleConfigResponse(
|
|
90
|
+
response,
|
|
91
|
+
endpoint,
|
|
92
|
+
!!this.options.auth
|
|
93
|
+
);
|
|
94
|
+
window.gradio_config = {
|
|
95
|
+
...config,
|
|
96
|
+
current_page: window.gradio_config.current_page
|
|
97
|
+
};
|
|
98
|
+
}
|
|
80
99
|
window.gradio_config.root = endpoint;
|
|
81
100
|
return { ...window.gradio_config };
|
|
82
101
|
} else if (endpoint) {
|
|
@@ -165,13 +184,6 @@ function determine_protocol(endpoint) {
|
|
|
165
184
|
http_protocol: protocol,
|
|
166
185
|
host: host + (pathname !== "/" ? pathname : "")
|
|
167
186
|
};
|
|
168
|
-
} else if (endpoint.startsWith("file:")) {
|
|
169
|
-
return {
|
|
170
|
-
ws_protocol: "ws",
|
|
171
|
-
http_protocol: "http:",
|
|
172
|
-
host: "lite.local"
|
|
173
|
-
// Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
|
|
174
|
-
};
|
|
175
187
|
}
|
|
176
188
|
return {
|
|
177
189
|
ws_protocol: "wss",
|
package/dist/types.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ export interface Config {
|
|
|
134
134
|
dependencies: number[];
|
|
135
135
|
layout: any;
|
|
136
136
|
}>;
|
|
137
|
-
pages: [string, string][];
|
|
137
|
+
pages: [string, string, boolean][];
|
|
138
138
|
protocol: "sse_v3" | "sse_v2.1" | "sse_v2" | "sse_v1" | "sse" | "ws";
|
|
139
139
|
max_file_size?: number;
|
|
140
140
|
theme_hash?: number;
|
|
@@ -167,6 +167,7 @@ interface SharedProps {
|
|
|
167
167
|
components?: string[];
|
|
168
168
|
server_fns?: string[];
|
|
169
169
|
interactive: boolean;
|
|
170
|
+
visible: boolean | "hidden";
|
|
170
171
|
[key: string]: unknown;
|
|
171
172
|
root_url?: string;
|
|
172
173
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,IAAI,EAAE;QACL,IAAI,EAAE,GAAG,CAAC;QACV,WAAW,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD;AAED,M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HANGED
|
@@ -77,12 +77,33 @@ export async function resolve_config(
|
|
|
77
77
|
if (
|
|
78
78
|
typeof window !== "undefined" &&
|
|
79
79
|
window.gradio_config &&
|
|
80
|
-
location.origin !== "http://localhost:9876"
|
|
81
|
-
!window.gradio_config.dev_mode
|
|
80
|
+
location.origin !== "http://localhost:9876"
|
|
82
81
|
) {
|
|
83
82
|
if (window.gradio_config.current_page) {
|
|
84
83
|
endpoint = endpoint.substring(0, endpoint.lastIndexOf("/"));
|
|
85
84
|
}
|
|
85
|
+
if (window.gradio_config.dev_mode) {
|
|
86
|
+
let config_url = join_urls(
|
|
87
|
+
endpoint,
|
|
88
|
+
this.deep_link
|
|
89
|
+
? CONFIG_URL + "?deep_link=" + this.deep_link
|
|
90
|
+
: CONFIG_URL
|
|
91
|
+
);
|
|
92
|
+
const response = await this.fetch(config_url, {
|
|
93
|
+
headers,
|
|
94
|
+
credentials: "include"
|
|
95
|
+
});
|
|
96
|
+
const config = await handleConfigResponse(
|
|
97
|
+
response,
|
|
98
|
+
endpoint,
|
|
99
|
+
!!this.options.auth
|
|
100
|
+
);
|
|
101
|
+
// @ts-ignore
|
|
102
|
+
window.gradio_config = {
|
|
103
|
+
...config,
|
|
104
|
+
current_page: window.gradio_config.current_page
|
|
105
|
+
};
|
|
106
|
+
}
|
|
86
107
|
window.gradio_config.root = endpoint;
|
|
87
108
|
// @ts-ignore
|
|
88
109
|
return { ...window.gradio_config } as Config;
|
|
@@ -202,14 +223,6 @@ export function determine_protocol(endpoint: string): {
|
|
|
202
223
|
http_protocol: protocol as "http:" | "https:",
|
|
203
224
|
host: host + (pathname !== "/" ? pathname : "")
|
|
204
225
|
};
|
|
205
|
-
} else if (endpoint.startsWith("file:")) {
|
|
206
|
-
// This case is only expected to be used for the Wasm mode (Gradio-lite),
|
|
207
|
-
// where users can create a local HTML file using it and open the page in a browser directly via the `file:` protocol.
|
|
208
|
-
return {
|
|
209
|
-
ws_protocol: "ws",
|
|
210
|
-
http_protocol: "http:",
|
|
211
|
-
host: "lite.local" // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
|
|
212
|
-
};
|
|
213
226
|
}
|
|
214
227
|
|
|
215
228
|
// default to secure if no protocol is provided
|
|
@@ -74,16 +74,6 @@ describe("determine_protocol", () => {
|
|
|
74
74
|
host: "huggingface.co"
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
|
-
|
|
78
|
-
it('should return the correct protocols and host when the endpoint starts with "file"', () => {
|
|
79
|
-
const endpoint = "file:///path/to/app.html";
|
|
80
|
-
const result = determine_protocol(endpoint);
|
|
81
|
-
expect(result).toEqual({
|
|
82
|
-
ws_protocol: "ws",
|
|
83
|
-
http_protocol: "http:",
|
|
84
|
-
host: "lite.local"
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
77
|
});
|
|
88
78
|
|
|
89
79
|
describe("parse_and_set_cookies", () => {
|
package/src/types.ts
CHANGED
|
@@ -190,7 +190,7 @@ export interface Config {
|
|
|
190
190
|
layout: any;
|
|
191
191
|
}
|
|
192
192
|
>;
|
|
193
|
-
pages: [string, string][];
|
|
193
|
+
pages: [string, string, boolean][];
|
|
194
194
|
protocol: "sse_v3" | "sse_v2.1" | "sse_v2" | "sse_v1" | "sse" | "ws";
|
|
195
195
|
max_file_size?: number;
|
|
196
196
|
theme_hash?: number;
|
|
@@ -226,6 +226,7 @@ interface SharedProps {
|
|
|
226
226
|
components?: string[];
|
|
227
227
|
server_fns?: string[];
|
|
228
228
|
interactive: boolean;
|
|
229
|
+
visible: boolean | "hidden";
|
|
229
230
|
[key: string]: unknown;
|
|
230
231
|
root_url?: string;
|
|
231
232
|
}
|