1- import { RedisClient } from 'redis' ;
1+ import { Callback , RedisClient } from 'redis' ;
22import { Tensor } from './tensor' ;
33import { Model } from './model' ;
44import * as util from 'util' ;
@@ -26,7 +26,7 @@ export class Client {
2626 }
2727
2828 public tensorset ( keName : string , t : Tensor ) : Promise < any > {
29- const args = [ keName , t . dtype ] ;
29+ const args : any [ ] = [ keName , t . dtype ] ;
3030 t . shape . forEach ( ( value ) => args . push ( value . toString ( ) ) ) ;
3131 if ( t . data != null ) {
3232 args . push ( 'VALUES' ) ;
@@ -36,7 +36,7 @@ export class Client {
3636 }
3737
3838 public tensorget ( keName : string ) : Promise < any > {
39- const args = [ keName , 'META' , 'VALUES' ] ;
39+ const args : any [ ] = [ keName , 'META' , 'VALUES' ] ;
4040 return this . _sendCommand ( 'ai.tensorget' , args )
4141 . then ( ( reply : any [ ] ) => {
4242 let dt = null ;
@@ -69,7 +69,7 @@ export class Client {
6969 }
7070
7171 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 ] ;
7373 if ( m . tag !== undefined ) {
7474 args . push ( 'TAG' ) ;
7575 args . push ( m . tag . toString ( ) ) ;
@@ -83,25 +83,25 @@ export class Client {
8383 m . outputs . forEach ( ( value ) => args . push ( value ) ) ;
8484 }
8585 args . push ( 'BLOB' ) ;
86- args . push ( m . blob . toString ( ) ) ;
86+ args . push ( m . blob ) ;
8787 return this . _sendCommand ( 'ai.modelset' , args ) ;
8888 }
8989
9090 public modelrun ( modelName : string , inputs : string [ ] , outputs : string [ ] ) : Promise < any > {
91- const args = [ modelName , 'INPUTS' ] ;
91+ const args : any [ ] = [ modelName , 'INPUTS' ] ;
9292 inputs . forEach ( ( value ) => args . push ( value ) ) ;
9393 args . push ( 'OUTPUTS' ) ;
9494 outputs . forEach ( ( value ) => args . push ( value ) ) ;
9595 return this . _sendCommand ( 'ai.modelrun' , args ) ;
9696 }
9797
9898 public modeldel ( modelName : string ) : Promise < any > {
99- const args = [ modelName ] ;
99+ const args : any [ ] = [ modelName ] ;
100100 return this . _sendCommand ( 'ai.modeldel' , args ) ;
101101 }
102102
103103 public modelget ( modelName : string ) : Promise < any > {
104- const args = [ modelName , 'META' , 'BLOB' ] ;
104+ const args : any [ ] = [ modelName , 'META' , 'BLOB' ] ;
105105 return this . _sendCommand ( 'ai.modelget' , args )
106106 . then ( ( reply : any [ ] ) => {
107107 let backend = null ;
@@ -143,7 +143,7 @@ export class Client {
143143 }
144144
145145 public scriptset ( keName : string , s : Script ) : Promise < any > {
146- const args = [ keName , s . device ] ;
146+ const args : any [ ] = [ keName , s . device ] ;
147147 if ( s . tag !== undefined ) {
148148 args . push ( 'TAG' ) ;
149149 args . push ( s . tag ) ;
@@ -154,20 +154,20 @@ export class Client {
154154 }
155155
156156 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' ] ;
158158 inputs . forEach ( ( value ) => args . push ( value ) ) ;
159159 args . push ( 'OUTPUTS' ) ;
160160 outputs . forEach ( ( value ) => args . push ( value ) ) ;
161161 return this . _sendCommand ( 'ai.scriptrun' , args ) ;
162162 }
163163
164164 public scriptdel ( scriptName : string ) : Promise < any > {
165- const args = [ scriptName ] ;
165+ const args : any [ ] = [ scriptName ] ;
166166 return this . _sendCommand ( 'ai.scriptdel' , args ) ;
167167 }
168168
169169 public scriptget ( scriptName : string ) : Promise < any > {
170- const args = [ scriptName , 'META' , 'SOURCE' ] ;
170+ const args : any [ ] = [ scriptName , 'META' , 'SOURCE' ] ;
171171 return this . _sendCommand ( 'ai.scriptget' , args )
172172 . then ( ( reply : any [ ] ) => {
173173 let device = null ;
@@ -208,7 +208,7 @@ export class Client {
208208 * @param keyName
209209 */
210210 public infoResetStat ( keyName : string ) : Promise < any > {
211- const args = [ keyName , 'RESETSTAT' ] ;
211+ const args : any [ ] = [ keyName , 'RESETSTAT' ] ;
212212 return this . _sendCommand ( 'ai.info' , args ) ;
213213 }
214214
@@ -217,7 +217,7 @@ export class Client {
217217 * @param keyName
218218 */
219219 public info ( keyName : string ) : Promise < any > {
220- const args = [ keyName ] ;
220+ const args : any [ ] = [ keyName ] ;
221221 return this . _sendCommand ( 'ai.info' , args )
222222 . then ( ( reply : any [ ] ) => {
223223 let keystr : string | null = null ;
0 commit comments