modules
@hotg-ai/forge / Exports
@hotg-ai/forge
Table of contents​
Classes​
Type aliases​
Functions​
Type aliases​
Evaluate​
Ƭ Evaluate: (inputs
: Inputs
| ReadInput
) => OutputValue
[]
Type declaration​
â–¸ (inputs
): OutputValue
[]
Parameters​
Name | Type |
---|---|
inputs | Inputs | ReadInput |
Returns​
ForgeHook​
Ƭ ForgeHook: NotLoaded
| Loading
| LoadingFailed
| Loaded
The current state of the Forge hook.
Inputs​
Ƭ Inputs: Object
A convenience type that can be used when all inputs are known ahead of time and you want things to "Just Work" out of the box.
Type declaration​
Name | Type |
---|---|
audio? | AudioBuffer [] |
floatImage? | HTMLImageElement [] |
image? | HTMLImageElement [] |
text? | string [] |
OutputValue​
Ƭ OutputValue: Object
A tensor value generated by the SERIAL output.
Type declaration​
Name | Type | Description |
---|---|---|
channel | number | An integer specifying which SERIAL output this is attached to. |
dimensions | number [] | The tensor's dimensions. |
elements | string [] | number [] | The elements in this tensor, flattened into a single array in row-major order. |
type_name | string | The Rust name for this tensor's element type. |
Parameters​
Ƭ Parameters: Object
Type declaration​
Name | Type | Description |
---|---|---|
apiKey | string | An API key used to authenticate with the Forge backend. |
backend? | "forge" | "enterprise" | Choose which backend to fetch Runes from. If not provided, defaults to Forge. |
baseURL? | string | Override the base URL used for the interacting with the backend. This is normally only used when using the enterprise backend, routing requests through a proxy, or developing Forge itself. |
deploymentId | number | The identifier of the Rune being deployed. |
telemetry? | Partial <TelemetryConfig > | null | Configuration for the telemetry system. The default config is used if this field is undefined. If an object is provided, any fields that are set will override the corresponding field from the default config. Set to null to opt out of telemetry. |
Functions​
default​
â–¸ default(parameters
, signal?
): Promise
<Evaluate
>
Load a Rune from the Forge backend.
Parameters​
Name | Type | Description |
---|---|---|
parameters | Parameters | arguments used to specify how a Rune is loaded from the Forge backend. |
signal? | AbortSignal | a signal that can be used to abort a pending download. |
Returns​
Promise
<Evaluate
>
Prediction of the values and inference
registerBackend​
â–¸ registerBackend(backend
): void
Register an inference backend for a particular model type.
Parameters​
Name | Type | Description |
---|---|---|
backend | ModelBackend | the backend to register. |
Returns​
void
useForge​
â–¸ useForge(params?
): ForgeHook
A React hook which will try to load a Rune from Forge in the background.
Parameters​
Name | Type | Description |
---|---|---|
params? | Parameters | parameters used for loading the Rune. |
Returns​
the loaded Rune, or an object representing the state