-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] added support for scriptset, scriptget, scriptrun, scriptdel, m…
…odeldel, and modelget
- Loading branch information
1 parent
e05df1e
commit 3c5de6b
Showing
8 changed files
with
443 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { DTypeMap, Dtype } from './dtype'; | ||
import { Model } from './model'; | ||
import { BackendMap, Backend } from './backend'; | ||
import { Dtype, DTypeMap } from './dtype'; | ||
import { Backend, BackendMap } from './backend'; | ||
import { Tensor } from './tensor'; | ||
import { Model } from './model'; | ||
import { Script } from './script'; | ||
import { Client } from './client'; | ||
|
||
export { DTypeMap, Dtype, BackendMap, Backend, Model, Tensor, Client }; | ||
export { DTypeMap, Dtype, BackendMap, Backend, Model, Script, Tensor, Client }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Direct mapping to RedisAI Script | ||
*/ | ||
|
||
export class Script { | ||
/** | ||
* | ||
* @param device - the device that will execute the model. can be of CPU or GPU | ||
* @param script - a string containing TorchScript source code | ||
*/ | ||
constructor(device: string, script: string) { | ||
this._device = device; | ||
this._script = script; | ||
this._tag = undefined; | ||
} | ||
|
||
// tag is an optional string for tagging the model such as a version number or any arbitrary identifier | ||
private _tag: string | undefined; | ||
|
||
get tag(): string | undefined { | ||
return this._tag; | ||
} | ||
|
||
/** | ||
* sets an optional string for tagging the model such as a version number or any arbitrary identifier | ||
* @param value | ||
*/ | ||
set tag(value: string | undefined) { | ||
this._tag = value; | ||
} | ||
|
||
private _device: string; | ||
|
||
get device(): string { | ||
return this._device; | ||
} | ||
|
||
set device(value: string) { | ||
this._device = value; | ||
} | ||
|
||
private _script: string; | ||
|
||
get script(): string { | ||
return this._script; | ||
} | ||
|
||
set script(value: string) { | ||
this._script = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.