pgml-cms/docs/open-source/pgml/guides/llms/README.md
PostgresML integrates 🤗 Hugging Face Transformers to bring state-of-the-art models into the data layer. There are tens of thousands of pre-trained models with pipelines to turn raw inputs into useful results. Many state of the art deep learning architectures have been published and made available for download. You will want to browse all the models available to find the perfect solution for your dataset and task. For instance, with PostgresML you can:
See pgml.transform for examples of using transformers or pgml.tune for fine tuning.
PostgresML currently supports most LLM tasks for Natural Language Processing available on Hugging Face:
| Task | Name | Description |
|---|---|---|
| Fill mask | key-mask | Fill in the blank in a sentence. |
| Question answering | question-answering | Answer a question based on a context. |
| Summarization | summarization | Summarize a long text. |
| Text classification | text-classification | Classify a text as positive or negative. |
| Text generation | text-generation | Generate text based on a prompt. |
| Text-to-text generation | text-to-text-generation | Generate text based on an instruction in the prompt. |
| Token classification | token-classification | Classify tokens in a text. |
| Translation | translation | Translate text from one language to another. |
| Zero-shot classification | zero-shot-classification | Classify a text without training data. |
| Conversational | conversational | Engage in a conversation with the model, e.g. chatbot. |
Both versions of the pgml.transform() function also support structured inputs, formatted with JSON. Structured inputs are used with the conversational task, e.g. to differentiate between the system and user prompts. Simply replace the text array argument with an array of JSONB objects.