pinokiod 1.2.35 → 1.2.37

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.
@@ -1,3 +1,4 @@
1
+ const path = require('path')
1
2
  class Gradio {
2
3
  /*
3
4
  {
@@ -15,13 +16,20 @@ class Gradio {
15
16
  */
16
17
  async predict(req, ondata, kernel) {
17
18
  if (!this.client) {
18
- const { client } = await import('node-gradio-client');
19
+ //const gradio_path = path.resolve(__dirname, '../../../node_modules/node-gradio-client/dist')
20
+ const gradio_path = path.resolve(__dirname, '../../../node_modules/node-gradio-client/dist/index.js')
21
+ console.log("gradio_path", gradio_path)
22
+ //const gradio_path = 'node-gradio-client'
19
23
  // const dynamic = new Function('modulePath', 'return import(modulePath)');
20
- // const { client } = await dynamic('node-gradio-client');
24
+ // const { client } = await dynamic(gradio_path)
25
+ const { client } = await import(gradio_path)
26
+ console.log("Client", client)
21
27
  //const { client } = await dynamic('@gradio/client');
22
28
  this.client = client
23
29
  }
24
30
  const app = await this.client(req.params.uri)
31
+ // console.log("PREDICT", client)
32
+ //const app = await client(req.params.uri)
25
33
 
26
34
 
27
35
  // params parsing
@@ -53,7 +61,7 @@ class Gradio {
53
61
  // }
54
62
 
55
63
  let args = req.params.params
56
- console.log("args", args)
64
+ console.log("Args", args)
57
65
  let res = await app.predict(req.params.path, args)
58
66
  return res
59
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.2.35",
3
+ "version": "1.2.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {