This documentation describes the integration of MindsDB with Hugging Face, a company that develops computer tools for building applications using machine learning.
The integration allows for the deployment of Hugging Face models within MindsDB, providing the models with access to data from various data sources.
Create a model using huggingface_engine as an engine.
Copy
Ask AI
CREATE MODEL huggingface_modelPREDICT target_columnUSING engine = 'huggingface_engine', -- engine name as created via CREATE ML_ENGINE model_name = 'hf_hub_model_name', -- choose one of PyTorch models from the Hugging Face Hub task = 'task_name', -- choose one of 'text-classification', 'text-generation', 'zero-shot-classification', 'translation', 'summarization', 'text2text-generation', 'fill-mask' input_column = 'column_name', -- column that stores input/question to the model labels = ['label 1', 'label 2']; -- labels used to classify data (used for classification tasks)
The following usage examples utilize huggingface_engine to create a model with the CREATE MODEL statement.Create a model to classify input text as spam or ham.
SELECT text, spam_or_hamFROM spam_classifierWHERE text = 'Subscribe to this channel asap';
Here is the output:
Copy
Ask AI
+--------------------------------+-------------+| text | spam_or_ham |+--------------------------------+-------------+| Subscribe to this channel asap | spam |+--------------------------------+-------------+
Next StepsFollow this link to see more use case examples.