pinokiod 1.2.35 → 1.2.36
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.
|
@@ -15,13 +15,16 @@ class Gradio {
|
|
|
15
15
|
*/
|
|
16
16
|
async predict(req, ondata, kernel) {
|
|
17
17
|
if (!this.client) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const gradio_path = '../../../node_modules/node-gradio-client/dist/index.js'
|
|
19
|
+
const dynamic = new Function('modulePath', 'return import(modulePath)');
|
|
20
|
+
const { client } = await dynamic(gradio_path)
|
|
21
|
+
console.log("client", client)
|
|
21
22
|
//const { client } = await dynamic('@gradio/client');
|
|
22
23
|
this.client = client
|
|
23
24
|
}
|
|
24
25
|
const app = await this.client(req.params.uri)
|
|
26
|
+
// console.log("PREDICT", client)
|
|
27
|
+
//const app = await client(req.params.uri)
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
// params parsing
|
|
@@ -53,7 +56,7 @@ class Gradio {
|
|
|
53
56
|
// }
|
|
54
57
|
|
|
55
58
|
let args = req.params.params
|
|
56
|
-
console.log("
|
|
59
|
+
console.log("Args", args)
|
|
57
60
|
let res = await app.predict(req.params.path, args)
|
|
58
61
|
return res
|
|
59
62
|
}
|