SQuARE Model Inference API (0.1.0)
Download OpenAPI specification:Download
API reference for model inference.
Sequence Classification
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Sequence Classification
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Token Classification
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Token Classification
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Embedding
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Embedding
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Question Answering
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Question Answering
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Generation
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Generation
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
required | Array of Input (strings) or Array of Input (strings) or Input (object) (Input) Input for the model. Supports Huggingface Transformer inputs (i.e., list of sentences, or list of pairs of sentences), a dictionary with Transformer inputs, or a dictionary containing numpy arrays (as lists). For the numpy arrays, also set is_preprocessed=True. |
is_preprocessed | boolean (Is Preprocessed) Default: false Flag indicating that the input contains already pre-processed numpy arrays as list and that it needs no further pre-processing. |
preprocessing_kwargs | object (Preprocessing Kwargs) Default: {} Optional dictionary containing additional parameters for the pre-processing step. |
model_kwargs | object (Model Kwargs) Default: {} Optional dictionary containing parameters that are passed to the model for the forward pass to control what additional tensors are returned. |
task_kwargs | object (Task Kwargs) Default: {} Optional dictionary containing additional parameters for handling of the task and task-related post-processing. |
explain_kwargs | object (Explain Kwargs) Default: {} Optional dictionary containing additional parameters for explaining predictions |
attack_kwargs | object (Attack Kwargs) Default: {} Optional dictionary containing additional parameters for attacking models |
Adapter Name (string) or Array of Adapter Name (strings) (Adapter Name) Default: "" Only necessary for Adapter. The fully specified name of the to-be-used adapter from adapterhub.ml |
Responses
Request samples
- Payload
{- "input": [
- "string"
], - "is_preprocessed": false,
- "preprocessing_kwargs": { },
- "model_kwargs": { },
- "task_kwargs": { },
- "explain_kwargs": { },
- "attack_kwargs": { },
- "adapter_name": ""
}
Response samples
- 200
- 422
{- "message": "string",
- "task_id": "string"
}
Statistics
Returns the statistics of the model :return: the ModelStatistics for the model
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Responses
Response samples
- 200
- 422
{- "model_type": "string",
- "model_name": "string",
- "batch_size": 0,
- "max_input": 0,
- "model_class": "string",
- "disable_gpu": true,
- "return_plaintext_arrays": true,
- "preloaded_adapters": true,
- "transformers_cache": ".cache",
- "model_path": "string",
- "decoder_path": "string",
- "onnx_use_quantized": true,
- "is_encoder_decoder": true
}
Statistics
Returns the statistics of the model :return: the ModelStatistics for the model
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Responses
Response samples
- 200
- 422
{- "model_type": "string",
- "model_name": "string",
- "batch_size": 0,
- "max_input": 0,
- "model_class": "string",
- "disable_gpu": true,
- "return_plaintext_arrays": true,
- "preloaded_adapters": true,
- "transformers_cache": ".cache",
- "model_path": "string",
- "decoder_path": "string",
- "onnx_use_quantized": true,
- "is_encoder_decoder": true
}
Update
Update the model with the given parameters. (not all parameters can be updated through this method e.g. the model class is linked to the model, hence it can't be updated during runtime) :param updated_param: the new parameters :return: the information about the updated model
Authorizations:
path Parameters
identifier required | string (Identifier) |
hf_username required | string (Hf Username) |
Request Body schema: application/json
disable_gpu | boolean (Disable Gpu) |
batch_size | integer (Batch Size) |
max_input | integer (Max Input) |
return_plaintext_arrays | boolean (Return Plaintext Arrays) |
Responses
Request samples
- Payload
{- "disable_gpu": true,
- "batch_size": 0,
- "max_input": 0,
- "return_plaintext_arrays": true
}
Response samples
- 200
- 422
null
Update
Update the model with the given parameters. (not all parameters can be updated through this method e.g. the model class is linked to the model, hence it can't be updated during runtime) :param updated_param: the new parameters :return: the information about the updated model
Authorizations:
path Parameters
identifier required | string (Identifier) |
query Parameters
hf_username | string (Hf Username) |
Request Body schema: application/json
disable_gpu | boolean (Disable Gpu) |
batch_size | integer (Batch Size) |
max_input | integer (Max Input) |
return_plaintext_arrays | boolean (Return Plaintext Arrays) |
Responses
Request samples
- Payload
{- "disable_gpu": true,
- "batch_size": 0,
- "max_input": 0,
- "return_plaintext_arrays": true
}
Response samples
- 200
- 422
null