thanosql.predict()
predict
function in ThanoSQL is designed to perform various prediction tasks using pre-trained models. This function supports a range of tasks, leveraging the capabilities of different engines.
Parameter | Type | Default | Description | Options |
---|---|---|---|---|
task | string | The prediction task to perform. | 'text-classification' , 'sentiment-analysis' , 'summarization' , 'image-classification' , 'image-segmentation' , 'audio-classification' , 'automatic-speech-recognition' , 'video-classification' | |
engine | string | 'huggingface' | The engine to use for performing predictions. | 'huggingface' : Uses models from HuggingFace. |
input | string | The input data for the prediction task. It can be text, a URL, an S3 URI, or a path to a local file. | N/A | |
model | string | The name or path of the pre-trained model. | Example: 'google-bert/bert-base-uncased' | |
model_args | json | None | JSON string representing additional arguments for the model. | N/A |
pipeline_args | json | None | JSON string representing additional arguments for the pipeline. | N/A |
task_args | json | None | JSON string representing additional arguments specific to the task. | N/A |
token | string | None | Token for authentication if required by the model. | N/A |
base_url | string | None | Base URL to point the client to a different endpoint than the default OpenAI API endpoint. This is only applicable when the engine is openai . | N/A |
huggingface
engine, the default truncation_policy
is ‘strict’. This could result in an error if the token count exceeds the model’s limit. If this happens, reduce the text length or use pipeline_args = "{'truncation_policy': True}"
.predict
function for text classification using a Hugging Face model:
predict
function for sentiment analysis using a Hugging Face model:
predict
function for summarization using a Hugging Face model:
predict
function for image classification using a Hugging Face model:
predict
function for image segmentation using a Hugging Face model:
predict
function for audio classification using a Hugging Face model:
predict
function for automatic speech recognition using a Hugging Face model:
predict
function for automatic speech recognition using an OpenAI model:
predict
function for video classification using a Hugging Face model:
predict
function with the huggingface
engine, ensure that only models compatible with the HuggingFace pipeline are used. Verify that the selected model is supported by the HuggingFace library to avoid compatibility issues. Even with compatible tasks and pipeline models, some models might still not work. We are actively working on improving compatibility and functionality to provide a better user experience. For more information, refer to the official HuggingFace documentation.