This is a collection of examples for the clarifai-python SDK and Integrations done with Clarifai SDK. Use these examples to learn Clarifai and build your own robust and scalable AI applications.
Experience the power of Clarifai in building Computer Vision , Natual Language processsing , Generative AI applications.
Website | Schedule Demo | Signup for a Free Account | API Docs | Clarifai Community | Python SDK Docs | Examples | Colab Notebooks | Discord
-
Sign up for a free account at clarifai and set your PAT key.
-
You can generate PAT key in the Personal settings -> Security section
-
Install the Clarifai python sdk.
-
Export your PAT as an environment variable.
export CLARIFAI_PAT={your personal access token}
-
Explore and run the examples in this repo.
The examples are organized into several folders based on their category. A quick example below,
from clarifai.client.dataset import Dataset
dataset = Dataset(user_id="user_id", app_id="app_id", dataset_id="dataset_id")
dataset.upload_dataset(task="text_clf", split="train", module_dir="path_to_imdb_reviews_module")
Function | Notebook | Description | Open in Colab |
---|---|---|---|
Basics | Basics | Basic Functionalities (create, list, patch, delete) of SDK App, Dataset, Input & Model Classes | |
Compute Orchestration | CRUD Operations | Basic Functionalities (create, list, get, delete) of Compute Orchestration Classes - ComputeCluster, Nodepool, Deployment | |
Concepts | Concept Management | Basic Functionalities (add, search, delete) of Concept Relations | |
Datasets | Basics | Basic Functionalities of Dataset & Input Class in SDK | |
Input Upload | Upload Functionalities of SDK with different kinds of data (image, text, audio, video ) and annotations (classes, bbox, etc) using Input Class | ||
Dataset Upload | Upload Functionalities of SDK with different of dataset annotation formats (Clarifai, Cifar10, VOC, etc.) using Dataset Class | ||
Dataset Export | Export Functionalities of SDK to different of dataset annotation formats (Clarifai, Cifar10, VOC, etc.) using Dataset Class | ||
Workflows | Create Workflow | Different kinds of Workflow Creation examples using SDK | |
Patch Workflow | Modifying a workflow with patch operations using SDK Workflow Class | ||
Export Workflow | Exporting Workflow config and create a modified workflow using SDK Workflow Class | ||
Model Predict | Model Predict | Prediction Functionalities of SDK Model Class for different type of input data | |
Model Training | Image Classification Training | Model Train demo for Visual-Classifier model type with MMClassification_EfficientNet Template | |
Text Classification Training | Model Train demo for Text-Classifier model type with HF_GPTNeo_125m_lora template | ||
Image Detection Training | Model Train demo for Visual-Detector model type with MMDetection template | ||
Image Segmentation Training | Model Train demo for Visual-Segmenter model type with MMDetection template | ||
Transfer Learn Training | Model Train demo for Embedded-Classifier model type using Transfer-Learning | ||
Model Evaluation | Embedding Classifier | Model Eval demo for Embedded-Classifier model type using SDK | |
Text Classifier | Model Eval demo for Text-Classifier model type using SDK | ||
Visual Classifier | Model Eval demo for Visual-Classifier model type using SDK | ||
Visual Detector | Model Eval demo for Visual-Detector model type using SDK | ||
Search | Vector Search | Introductory guide to setting up a Cross-Modal Search system using SDK | |
RAG | RAG | RAG setup and chat with the RAG interface. |
Integration | Function | Notebook | Open in Colab |
---|---|---|---|
Langchain | Chains | Prompt Templates and Chains | |
Retrieval QA Chain | |||
Router Chain | |||
PostgreSQL LLM | |||
Agents | Conversational Agent | ||
ReAct Docstore Agent | |||
Unstructured.io | Github Data Ingestion | ||
S3 Data Ingestion | |||
DropBox Data Ingestion |
Data Util | Function | Notebook | Open in Colab |
---|---|---|---|
Image | Image Annotation | annotation loader | |
Multimodal | Data Ingestion | Ready to Use Pipelines | |
Data Ingestion | Multimodal Ingestion |
There is an exciting new model upload experience now in private preview. We'd love for you to try it out and give us feedback! If you're interested, please sign up for private preview here.
Although these scripts are run on your local machine, they'll communicate with Clarifai and run in our cloud on demand.
Examples provide a guided tour through Clarifai's concepts and capabilities. contains uncategorized, miscellaneous examples.