1
- import { RedisClient } from 'redis' ;
1
+ import { Callback , RedisClient } from 'redis' ;
2
2
import { Tensor } from './tensor' ;
3
3
import { Model } from './model' ;
4
4
import * as util from 'util' ;
@@ -26,7 +26,7 @@ export class Client {
26
26
}
27
27
28
28
public tensorset ( keName : string , t : Tensor ) : Promise < any > {
29
- const args = [ keName , t . dtype ] ;
29
+ const args : any [ ] = [ keName , t . dtype ] ;
30
30
t . shape . forEach ( ( value ) => args . push ( value . toString ( ) ) ) ;
31
31
if ( t . data != null ) {
32
32
args . push ( 'VALUES' ) ;
@@ -36,7 +36,7 @@ export class Client {
36
36
}
37
37
38
38
public tensorget ( keName : string ) : Promise < any > {
39
- const args = [ keName , 'META' , 'VALUES' ] ;
39
+ const args : any [ ] = [ keName , 'META' , 'VALUES' ] ;
40
40
return this . _sendCommand ( 'ai.tensorget' , args )
41
41
. then ( ( reply : any [ ] ) => {
42
42
let dt = null ;
@@ -69,7 +69,7 @@ export class Client {
69
69
}
70
70
71
71
public modelset ( keName : string , m : Model ) : Promise < any > {
72
- const args = [ keName , m . backend , m . device ] ;
72
+ let args : any [ ] = [ keName , m . backend . toString ( ) , m . device ] ;
73
73
if ( m . tag !== undefined ) {
74
74
args . push ( 'TAG' ) ;
75
75
args . push ( m . tag . toString ( ) ) ;
@@ -83,25 +83,25 @@ export class Client {
83
83
m . outputs . forEach ( ( value ) => args . push ( value ) ) ;
84
84
}
85
85
args . push ( 'BLOB' ) ;
86
- args . push ( m . blob . toString ( ) ) ;
86
+ args . push ( m . blob ) ;
87
87
return this . _sendCommand ( 'ai.modelset' , args ) ;
88
88
}
89
89
90
90
public modelrun ( modelName : string , inputs : string [ ] , outputs : string [ ] ) : Promise < any > {
91
- const args = [ modelName , 'INPUTS' ] ;
91
+ const args : any [ ] = [ modelName , 'INPUTS' ] ;
92
92
inputs . forEach ( ( value ) => args . push ( value ) ) ;
93
93
args . push ( 'OUTPUTS' ) ;
94
94
outputs . forEach ( ( value ) => args . push ( value ) ) ;
95
95
return this . _sendCommand ( 'ai.modelrun' , args ) ;
96
96
}
97
97
98
98
public modeldel ( modelName : string ) : Promise < any > {
99
- const args = [ modelName ] ;
99
+ const args : any [ ] = [ modelName ] ;
100
100
return this . _sendCommand ( 'ai.modeldel' , args ) ;
101
101
}
102
102
103
103
public modelget ( modelName : string ) : Promise < any > {
104
- const args = [ modelName , 'META' , 'BLOB' ] ;
104
+ const args : any [ ] = [ modelName , 'META' , 'BLOB' ] ;
105
105
return this . _sendCommand ( 'ai.modelget' , args )
106
106
. then ( ( reply : any [ ] ) => {
107
107
let backend = null ;
@@ -143,7 +143,7 @@ export class Client {
143
143
}
144
144
145
145
public scriptset ( keName : string , s : Script ) : Promise < any > {
146
- const args = [ keName , s . device ] ;
146
+ const args : any [ ] = [ keName , s . device ] ;
147
147
if ( s . tag !== undefined ) {
148
148
args . push ( 'TAG' ) ;
149
149
args . push ( s . tag ) ;
@@ -154,20 +154,20 @@ export class Client {
154
154
}
155
155
156
156
public scriptrun ( scriptName : string , functionName : string , inputs : string [ ] , outputs : string [ ] ) : Promise < any > {
157
- const args = [ scriptName , functionName , 'INPUTS' ] ;
157
+ const args : any [ ] = [ scriptName , functionName , 'INPUTS' ] ;
158
158
inputs . forEach ( ( value ) => args . push ( value ) ) ;
159
159
args . push ( 'OUTPUTS' ) ;
160
160
outputs . forEach ( ( value ) => args . push ( value ) ) ;
161
161
return this . _sendCommand ( 'ai.scriptrun' , args ) ;
162
162
}
163
163
164
164
public scriptdel ( scriptName : string ) : Promise < any > {
165
- const args = [ scriptName ] ;
165
+ const args : any [ ] = [ scriptName ] ;
166
166
return this . _sendCommand ( 'ai.scriptdel' , args ) ;
167
167
}
168
168
169
169
public scriptget ( scriptName : string ) : Promise < any > {
170
- const args = [ scriptName , 'META' , 'SOURCE' ] ;
170
+ const args : any [ ] = [ scriptName , 'META' , 'SOURCE' ] ;
171
171
return this . _sendCommand ( 'ai.scriptget' , args )
172
172
. then ( ( reply : any [ ] ) => {
173
173
let device = null ;
@@ -208,7 +208,7 @@ export class Client {
208
208
* @param keyName
209
209
*/
210
210
public infoResetStat ( keyName : string ) : Promise < any > {
211
- const args = [ keyName , 'RESETSTAT' ] ;
211
+ const args : any [ ] = [ keyName , 'RESETSTAT' ] ;
212
212
return this . _sendCommand ( 'ai.info' , args ) ;
213
213
}
214
214
@@ -217,7 +217,7 @@ export class Client {
217
217
* @param keyName
218
218
*/
219
219
public info ( keyName : string ) : Promise < any > {
220
- const args = [ keyName ] ;
220
+ const args : any [ ] = [ keyName ] ;
221
221
return this . _sendCommand ( 'ai.info' , args )
222
222
. then ( ( reply : any [ ] ) => {
223
223
let keystr : string | null = null ;
0 commit comments